Skip to content


== matcher fails with empty Diff #122

tvdeyen opened this Issue · 7 comments

2 participants


I expect two Objects to be the same with == matcher

ObjectA == ObjectA

RSpec fails with:

expected: #<ObjectA>
     got: #<ObjectA> (using ==)

Diff is empty? Why does it fail then?

RSpec member

What happens if you say (ObjectA == ObjectA).should be_true?


Hmm, they are, kind of:

assigns(:contact).should == AlchemyCrm::Contact.fake
def self.fake
        :salutation => 'mr',
        :title => 'Dr.',
        :firstname => 'Max',
        :lastname => 'Mustermann',
        :email => '',
        :phone => '040-1234567',
        :mobile => '0171-1234567',
        :address => 'Lange Straße 10',
        :zip => '20000',
        :city => 'Hamburg',
        :organisation => 'Musterfirma',
        :country => 'DE'

But then I can't match with be_a_new then, or?

RSpec member

You can try it, but I'm closing this because this is not rspec's issue. If you want help figuring out how to address this please write to the rspec-users list.

@dchelimsky dchelimsky closed this

Ok, but maybe rspec should show a better error, then Diff: (empty) so one knows whats the problem.

RSpec member

That tells you the problem! The problem is the objects say they are not equal, but there are no diffs between them.

RSpec member

But I'd consider it :) Feel free to file a separate feature request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.