I think the first example is better personally, it's more specific about 
what your expectation is asserting.  Also I'm pretty sure that "have" 
matcher was deprecated, dropped from rspec-expectations, and moved to this 
gem  https://github.com/rspec/rspec-collection_matchers .  Just a heads up 
that the book may be a bit dated.

On Tuesday, December 9, 2014 5:05:00 AM UTC-7, Roelof Wobben wrote:
>
> Hello, 
>
> I like to learn Rspec once again and im using the everydayRails book. 
>
> Now I see that one of the test looks like this : 
>
> expect ( build (:contact, firstname : 
> nill)).to_have(1).errors.on(:firstname) 
>
> but I wonder why not use this : 
>
> expect ( build (:contact, firstname : nill)).not_to_be valid 
>
> Roelof
>
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rspec/b6359298-4cf8-45a0-b2d8-db8876ac2e52%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to