sconover / wrong

Wrong provides a general assert method that takes a predicate block. Assertion failure messages are rich in detail.
MIT License
434 stars 31 forks source link

Puzzling behavior with eventually and rspec be_nil matcher #25

Open ziobrando opened 11 years ago

ziobrando commented 11 years ago

I found an odd behavior when using eventually and should_not be_nil.

it "should work with be_nil" do
    found = "X"
    eventually {
      found.should_not be_nil
    }
end

Error message is:

Expected found.should_not(be_nil), but found is "X" be_nil is #<RSpec::Matchers::BuiltIn::BeNil:0x007ff531aea8e8 @expected=nil>

Am I doing anything wrong?