rspec / rspec-mocks

RSpec's 'test double' framework, with support for stubbing and mocking
https://rspec.info
MIT License
1.16k stars 357 forks source link

Error message shows no difference #1493

Closed jcoyne closed 1 year ago

jcoyne commented 1 year ago

This test started failing on 3.11.2

       #<InstanceDouble(Blacklight::Solr::Repository) (anonymous)> received :suggestions with unexpected arguments
         expected: ({:q=>"test"})
              got: ({:q=>"test"})

When I pin rspec-mocks to 3.22.1, the error goes away.

The hash that is passed is in fact a different object, but they both contain the same data.

jrochkind commented 1 year ago

This test started failing on 3.11.2 When I pin rspec-mocks to 3.22.1, the error goes away.

Do you mean tests started failing on 3.22.2?

jcoyne commented 1 year ago

Do you mean tests started failing on 3.22.2?

No, I meant when I pin to 3.11.1 it works.

JonRowe commented 1 year ago

:wave: This is fixed in the yet to be released 3.12.0, you can use RSpec from main for now or await a release. There was a fix when detecting keyword arguments with with in 3.11.2 but the change to improve the diff requires a different release cycle, given that this may occur for a few people I'm working on releasing 3.12.0 either tonight or tomorrow.

JonRowe commented 1 year ago

3.12.0 is releases which should highligh the difference (that one is a keyword argument and the other a hash), feel free to provide a reproduction if you think thats in error (there is one unresolved issue related to this in #1492 )

jcoyne commented 1 year ago

Yes, loads better. Thanks!