[Rspec-users] 1 should be 2. huh?

David Chelimsky dchelimsky at gmail.com
Tue Oct 24 09:47:29 EDT 2006


Can you please submit an RFE on this one?

http://rubyforge.org/tracker/?group_id=797

Thanks,
David

On 10/24/06, Micah Martin <micah at 8thlight.com> wrote:
>
> There's another quirk I wanted to bring up.  It's about the failure message
> with should_equal and should_be.
>
> x.should_equal 2
> a.should_not_be nil
>
> When they fail they yield messages like:
>
> 1 should equal 2
> nil should not be nil
>
> When I'm caught off guard, which can be often, these messages confuse me.  1
> should equal 2?  No it shouldn't.  nil should not be nil?  But they are the
> same!
> You get my drift?  When taken out side the context of a specification, these
> statements are just absurd.
>
> In my humble opinion, these messages should include their context and read
> like this:
>
> x should equal 2 but was 1
> a should not be nil but was nil
>
> I realize there might be an issue printing the expression that gets
> evaluated, but you guys have done some cool magic to this point.  Have you
> got a bit more up your sleeves?
>
> Micah Martin
> 8th Light, Inc.
> www.8thlight.com
>
>
>
>
> _______________________________________________
> Rspec-users mailing list
> Rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
>


More information about the Rspec-users mailing list