-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Description
We've had a few issues and pull requests dealing with diffing, but I think we need a more holistic solution. There are a growing number of diffing solutions out there now, each of which are going to appeal more to some people than others, so I think we should have a reasonable default behavior, but then expose an API for choosing your own differ. Something like:
RSpec.configure do |c|
c.diff {|actual,expected| MyPreferredDefaultDiffer.diff(actual, expected)} # default
c.diff(Hash) {|expected,actual| MyPreferredHashDiffer.diff(expected, actual)}
c.diff(Array) {|expected,actual| MyPreferredArrayDiffer.diff(expected, actual)}
c.diff(String) {|expected,actual| MyPreferredStringDiffer.diff(expected, actual)}
# etc
endThe form with a single argument would invoke the supplied block if both expected and actual values match the argument, otherwise the default would be used.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels