Search code examples
ruby-on-railsrubyrspec-railsrspec2

RSpec 2 'something.should be`


I came across some horrible looking RSpec 2 test:

something.should be

Nope, I didn't accidentally forget to cut+paste the rest of the line, that's it!

So what's the exact semantic of that? should_not be_nil ?

Please chime in why this is horrible style.

IMHO it's sloppy, not precise, and does not clearly communicate what's required. (it triggers my gag reflex ;)


Solution

  • You're correct - according to the docs object.should.be equals object.should_not be_nil

    Documentation, 4th one down in that first list.