[rspec-users] [rspec] be_something accepts nils

Ashley Moran ashley.moran at patchspace.co.uk
Fri Mar 13 08:17:30 EDT 2009


Hi

Just noticed that the behaviour of

   @cow.should_not be_hungry

is not the same as

   @cow.hungry?.should == false # nil also passes

Don't know how this has escaped me for so long =)

What's the thinking behind this?  You can already do

   @cow.hungry?.should(_not) be_nil

so surely it makes more sense for be_true and be_false to check for  
booleans?

Ashley


-- 
http://www.patchspace.co.uk/
http://www.linkedin.com/in/ashleymoran
http://aviewfromafar.net/
http://twitter.com/ashleymoran








More information about the rspec-users mailing list