[rspec-users] Cucumber and matcher

David Chelimsky dchelimsky at gmail.com
Wed Mar 25 21:00:20 EDT 2009


On Wed, Mar 25, 2009 at 7:32 PM, Zach Dennis <zach.dennis at gmail.com> wrote:
> On Wed, Mar 25, 2009 at 7:18 PM, Emmanuel Pinault <seatmanu at gmail.com> 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!

Or the new Matcher DSL - simple matcher even simpler!

http://rspec.rubyforge.org/rspec/1.2.2/files/features/matchers/create_matcher_feature.html

>
>>
>>
>> Thanks
>>
>> Emmanuel
>>
>>
>> _______________________________________________
>> rspec-users mailing list
>> rspec-users at rubyforge.org
>> http://rubyforge.org/mailman/listinfo/rspec-users
>>
>
>
>
> --
> Zach Dennis
> http://www.continuousthinking.com
> http://www.mutuallyhuman.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