Change the differ for arrays of strings with newlines in them. #213

Merged
merged 2 commits into from Mar 28, 2013

Projects

None yet

3 participants

Member

Related to #212.

This changes the way arrays are formatted before being passed into the differ.

Member

So it looks like it doesn't work on 1.8.7 according to travis.

Owner
JonRowe commented Feb 28, 2013

Yep, it's because the to_s behaviour differs on 1.8.7 and 1.9.3, try using .inspect instead, a trivial test of your code made that work for me...

Owner
JonRowe commented Feb 28, 2013

Trivial meaning I ran your code as a plain.rb file in 1.8.7 and 1.9.3 and changing to_s to inspect made the outputs of your method identical, as opposed to differing which they do with 1.8.7.

Member

Awesome, I'll patch it up tomorrow.

On 28 Feb 2013, at 00:44, Jon Rowe wrote:

Trivial meaning I ran your code as a plain.rb file in 1.8.7 and 1.9.3 and changing to_s to inspect made the outputs of your method identical, as opposed to differing which they do with 1.8.7.


Reply to this email directly or view it on GitHub.

@samphippen samphippen Change the differ for arrays of strings with newlines in them.
Signed-off-by: Sam Phippen <samphippen@googlemail.com>
d72a1d7
Member

so "tomorrow" ended up being a month. @myronmarston thoughts?. Does this want a changelog entry under enhancements?

Owner

This looks great, @samphippen. Yes, I think a changelog entry under enhancements would be nice. I'll merge once you add that.

@samphippen samphippen Add a changelog entry for the new array differ.
Signed-off-by: Sam Phippen <samphippen@googlemail.com>
e0d885c
Member

pew pew pew.

@myronmarston myronmarston merged commit b3899f1 into rspec:master Mar 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment