[rspec-users] Cucumber ".should contain(expected) does but fails anyway

James Byrne lists at ruby-forum.com
Thu Apr 23 10:27:28 EDT 2009


David Chelimsky wrote:
> On Wed, Apr 22, 2009 at 2:09 PM, James Byrne <lists at ruby-forum.com> 
> wrote:
>>>> � � � (Spec::Expectations::ExpectationNotMetError)
>> Rates</title>"
>> WDYT?
> I like the idea, though I think it's helpful to also have the strings
> in the case of String objects. But having the class and object id
> would really help tell the story we're looking for.
> 
> wdYt?

I have come up with this spec.  Before I poke at the code itself I would 
like you to comment.

      it "should display object and value, expected and actual, on 
#failure_message" do
        target = 1
        matcher = equal("1")
        matcher.matches?(target)
        matcher.failure_message_for_should.should == \
          "\n" +
          "expected \"#{matcher.metaclass} => 1\"\n" +
          "     got \"#{target.metaclass} => 1\n" +
          "     \n(compared using equal?, did you mean '==')\n"
      end
-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list