-
-
Notifications
You must be signed in to change notification settings - Fork 102
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
Don't disregard trailing newlines in Differ input. #70 #71
Don't disregard trailing newlines in Differ input. #70 #71
Conversation
diff = differ.diff "abc", "def" | ||
|
||
expect(diff).to be_empty | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💭 This wasn't really related to this issue, but it was a missing test case so I threw it in just for completeness's sake.
Currently the build is failing with incorrect or unexpected diffs... |
@JonRowe Thanks for the heads up, I opened a PR against rspec-expectations to fix the specs that depended on Differ. |
The branch I opened on rspec-expectations, rspec/rspec-expectations#556, is passing, but this build is still failing. Is there some way I can make this use my branch of rspec-expectations on CI? |
Generally our procedure is to add a temporary commit linking the Gemfile to the branch, and then when passing, delete the commit and merge things simultaneously. |
I did that, unless I'm misunderstanding what you mean. |
You're not, for whatever reason your build is still failing against your branch |
Is this not an issue anymore, @phiggins? Sorry I never got around to reviewing it... |
It seemed like I was having to make pretty invasive changes to fix a minor edge case bug. The issues are still open so if there's interest these can be reopened. |
A fix for #70.
String#split
takes an optional second argument. From the docs:The difference being output like this:
I modified the methods that preprocessed the input to Differ to keep these empty strings for any trailing newlines. This worked to fix the issue in #70, but I had to modify lots of Differ's test cases since they used a trailing newline to trigger their diffability.