Re: [rspec-users] predicate matching

2009-09-18 Thread David Chelimsky
On Fri, Sep 18, 2009 at 11:31 AM, Yi Wen wrote: > Ok, I guess in reality it will never make a difference if a predicate > returns a nil or a false. > > The behavior annoys me a little bit when I write a test that passes when the > method itself does nothing (so that it returns nil). Any thoughts?

Re: [rspec-users] predicate matching

2009-09-18 Thread Yi Wen
Ok, I guess in reality it will never make a difference if a predicate returns a nil or a false. The behavior annoys me a little bit when I write a test that passes when the method itself does nothing (so that it returns nil). Any thoughts? Thanks Yi On Sep 18, 2009, at 11:06 AM, David

Re: [rspec-users] predicate matching

2009-09-18 Thread Yi Wen
Sorry for the spam, but I was wrong: the *should_not have_something* also passed when the method returned nil. On Sep 18, 2009, at 10:42 AM, Yi Wen wrote: Hi all, I noticed that if I have a method named has_somthing? and I do: object.should_not have_somthing and it failed (as expected) when

Re: [rspec-users] predicate matching

2009-09-18 Thread David Chelimsky
On Fri, Sep 18, 2009 at 10:42 AM, Yi Wen wrote: > Hi all, > > I noticed that if I have a method named has_somthing? and I do: > object.should_not have_somthing and it failed (as expected) when the method > returns nil. Actually, this should pass. The have_xxx and be_xxx matchers should pass/fail

[rspec-users] predicate matching

2009-09-18 Thread Yi Wen
Hi all, I noticed that if I have a method named has_somthing? and I do: object.should_not have_somthing and it failed (as expected) when the method returns nil. But if the method is something? and I do: object.should_not be_something, and it succeeded (not what I expected) when something? r