splitwise / super_diff

A more helpful way to view differences between complex data structures in RSpec.
https://splitwise.github.io/super_diff/
MIT License
946 stars 49 forks source link

rspec 3.13: breaking changes to ExpectedsForMultipleDiffs #250

Open jas14 opened 4 months ago

jas14 commented 4 months ago

~It appears that in rspec 3.12, have_attributes was an aliased matcher, but no longer is. I haven't tracked down the precise source of the change, but I added an Appraisal set for RSpec 3.13.0 and tests are failing.~

EDIT: I think I misdiagnosed – the issue may be the rename from RSpec::Matchers::{ExpectedsForMultipleDiffs -> MultiMatcherDiff }, see https://github.com/rspec/rspec-expectations/commit/81d3a5899ea5b0efccd14ae256cd09ada0b538a7 .

EDIT 2: it's both. 😭

jas14 commented 4 months ago

Suspect: https://github.com/rspec/rspec-expectations/commit/3d97c7ec0d3fcb28c7c97def68ba443634674684

AliasedMatcher now delegates almost everything – including and especially .is_a? – to the underlying matcher. Differs::ObjectHavingAttributes therefore no longer applies to the matcher: https://github.com/mcmire/super_diff/blob/fc418c15f04925e00f32298fc85f74c57591fc69/lib/super_diff/rspec.rb#L45https://github.com/mcmire/super_diff/blob/fc418c15f04925e00f32298fc85f74c57591fc69/lib/super_diff/rspec.rb#L45