splitwise / super_diff

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

super_diff does not work correctly in rspec matcher #105

Closed centralhardware closed 3 years ago

centralhardware commented 3 years ago

code:

RSpec::Matchers.define :matcher do |expected|
  match do |actual|
    expect(actual).to match(expected)
  end

  failure_message do |actual|

    end
  end
  diffable
end

in result^

don't show expected and to_mach

show

image

show content of expected but without difference beetwin actual and expected

mcmire commented 3 years ago

Thanks for the report! I'll take a look at what's going on here.

mcmire commented 3 years ago

@centralhardware I'm revisiting this, and actually, would you mind giving a more complete example? For instance, what is your expected and actual in this scenario? Otherwise I'm not sure what would be causing this.

mcmire commented 3 years ago

I'm going to close this as I need some more information to look into this further, but feel free to respond and I will reopen this!