[rspec-users] Rspec: `should': uninitialized constant RSpec::Expectations (NameError)

David Kahn lists at ruby-forum.com
Tue Dec 7 09:58:09 EST 2010


Wincent Colaiuta wrote in post #966456:
> El 06/12/2010, a las 01:19, DK escribi:
>
>> Hi all, anyone have an idea why I am getting an error trying to 'rake
>> spec':
>>
>> 'kernel.rb:27:in `should': uninitialized constant RSpec::Expectations
>> (NameError)'.
>
> Can you paste the full backtrace and the code of the spec which is
> causing this failure?
>
> It wouldn't surprise me if you had a naked example -- ie. nested inside
> a "describe/context" block, without an "it" block.
>
> I had one such example in an application with thousands of specs, so it
> slipped by unnoticed for a long while, but on moving to RSpec 2.1.0 this
> kind of latent bug is no longer tolerated. If you use a few levels of
> nesting to organize your specs it is quite possible for this kind of
> mistake to creep in.

Ahh... Wincent, you are right. Exactly the problem... so it was 
tolerated on an older version, and I was stuck thinking it was a 
configuration issue. Appreciated!

>
> Cheers,
> Wincent

-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list