[rspec-users] NO NAME (Because of --dry-run) output

Scott Taylor mailing_lists at railsnewbie.com
Sat Oct 13 23:21:06 EDT 2007


On Oct 13, 2007, at 9:59 PM, Steve wrote:

> On Sat, 06 Oct 2007 09:21:34 -0500, David Chelimsky wrote:
>
>> There is an auto-generation feature that let's you do this:
>>
>>   specify { something.should be_something }
>>
>> which would produce output:
>>
>> - should be something
>>
>> The thing is that it relies on actually running the examples, which
>> spec:doc does not do.
>>
>> If you're trying to run the specs so they produce the specdoc  
>> output, do this:
>>
>> script/spec spec -fs
>>
>> That will run the examples and produce the output.
>
> I'm running rspec and rspec_on_rails trunk(r2717), and am getting  
> this,
> except my "its" have string descriptions. One of my "describes"  
> looks like
> this:
>
> describe 'Person trying to logon' do
>   fixtures :users
>
>   it 'with an invalid username should fail' do
>     User.logon('harry', '123456').should be_nil
>   end
>
>   it 'with an invalid password should fail' do
>     User.logon(users(:admin).username, '').should be_nil
>   end
> end
>
> If I'm understanding you correctly, since I have the strings, with  
> spec:doc
> I should get output similar to:
>
> Person trying to logon
> - with an invalid username should fail
> - with an invalid password should fail
>
> But I'm just getting:
>
> Person trying to logon
> - NO NAME (Because of --dry-run)
> - NO NAME (Because of --dry-run)
>
> Further, I tried the script/spec -fs line mentioned, and get a rake
> failure complaining of too few args:
>
> script/spec spec -fs
> script/spec:4:in `run': wrong number of arguments (5 for 1)  
> (ArgumentError)
>         from script/spec:4
>

Try svn up, and rerunning script/generate rspec.  This should solve  
the second problem (unless this is a bug, again).

Scott





More information about the rspec-users mailing list