Forum: RSpec Cucumber and matcher

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Emmanuel P. (Guest)
on 2009-03-26 01:28
(Received via mailing list)
Hi,


Is there way to generate a better error messages when I have a matcher
in my step like

1.should == 0  => would fail with expected 1, got 0

I would like to add more details to that error?  Especially , in my
case ,I am using the include? matcher.


Thanks

Emmanuel
Zach D. (Guest)
on 2009-03-26 02:56
(Received via mailing list)
On Wed, Mar 25, 2009 at 7:18 PM, Emmanuel P. 
<removed_email_address@domain.invalid>
wrote:
> Hi,
>
>
> Is there way to generate a better error messages when I have a matcher in my
> step like
>
> 1.should == 0  => would fail with expected 1, got 0
>
> I would like to add more details to that error?  Especially , in my case ,I
> am using the include? matcher.

Check out rolling your own simple matcher:

http://apidock.com/rspec/Spec/Matchers/simple_matcher

It can be done in only a few lines!

> http://rubyforge.org/mailman/listinfo/rspec-users
>



--
Zach D.
http://www.continuousthinking.com
http://www.mutuallyhuman.com
David C. (Guest)
on 2009-03-26 03:31
(Received via mailing list)
On Wed, Mar 25, 2009 at 7:32 PM, Zach D. <removed_email_address@domain.invalid>
wrote:
>> am using the include? matcher.
>
> Check out rolling your own simple matcher:
>
> http://apidock.com/rspec/Spec/Matchers/simple_matcher
>
> It can be done in only a few lines!

Or the new Matcher DSL - simple matcher even simpler!

http://rspec.rubyforge.org/rspec/1.2.2/files/featu...
Emmanuel P. (Guest)
on 2009-03-26 06:28
(Received via mailing list)
Thanks David!

I will try the new matcher after I migrate to rspec 1.2.x  :)  But
seems a lot easier to create . Really liking it!

Emmanuel
This topic is locked and can not be replied to.