-
-
Notifications
You must be signed in to change notification settings - Fork 395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
include
matcher is not diffable enough
#1321
Comments
A PR is welcome. You can start with a pending spec. |
I don't quite understand the expected solution here, while the single And even if we knew what should be done, not sure if I'd have the capacity to do it. |
Our current differ is limited in that it has to diff everything as strings, so it "prints" objects to strings then diffs those strings. As the include matcher is diffing an array vs a single element, it's always going to be "wrong" when it comes to the diff, and we don't currently have an api to provide the differ with a more intelligent solution. Mutating the expected is a work around, but it might cause problems for re-use (which we support) and other downstream complications, for now I'm going to close this as a "can't fix" as its essentially a duplicate of out "we'd like to improve the differ" issues. |
@JonRowe What Issue should I subscribe to and read to help with the Differ limitations? |
Theres a couple over on rspec/rspec-support, contributions for improving the differ or making it configurable with say |
Subject of the issue
Consider:
diff for
my_includes
shows exact lines where the issue occurred, becauseinclude
matcher tries to compare single object with the whole array.It's especially useful when working with real/more complicated data structures, for me it's unfortunately
spend 3 minutes reading output or try to diff by hand
usually on similar failures.Your environment
mastermainThe text was updated successfully, but these errors were encountered: