-
-
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
The Differ no longer catches CompatibilityErrors #173
Conversation
This code was introduced in https://github.com/rspec/rspec-expectations/pull/220/files#diff-9533f5f156a38a3307ecfc610d2282d7R47 but is no longer raised either by the the current test code, the original test code @expected="Tu avec carté {count} itém has".encode('UTF-16LE') @Actual="Tu avec carte {count} item has".encode('UTF-16LE') or any other variations I've tried.
Sorry I don't want to remove this, I have seen this triggered in issues people have opened and its notoriously hard to replicate on a standard system so I'd rather have this safety net. |
Np, just wanted to put it out there for reference. I'd love to test if you see examples. |
If you'd like to fake up a spec for it to show what it does when triggered I'd merge, but I've had difficulty triggering this on Travis without stubbing out a call. |
I spent quite a bit of time trying to get the differ to raise this exception and never succeeded, so, maybe we should change the message to
|
I lean the other way -- I really hate leaving code in place "just in case". If we cannot find a way to replicate that particular exception I'd rather not continue to have the baggage of the (apparently) unneeded I think the worst case to removing it is some user gets an error, and they report it, which allows us to turn that into an actual regression spec, fix it, and get a patch release out quickly with the fix. If we do decide to keep that |
Normally I'd agree with you, but this is an observed edge case, just one we can't replicate on a standard UTF-8 machine, but saying we should remove it because we can't replicate it is like saying we should remove our windows fixes because we can't replicate them on OS X.
I'm ok with moving it... |
Well, if you're sure that the error can still occur that's different. I thought we were at the point where we thought it couldn't but you wanted to leave the rescue in place "just in case". As for the standard UTF-8 bit...I believe we can write specs (potentially that shell out to a new process if necessary) that have different default encodings in order to replicate such things.
I'd like to see that. As I said, it feels like an SRP violation and would also likely require us to rescue that error elsewhere if/when we start using |
We'd likely need to introduce more |
My 2 💰 is that it's a judgement call which way to go, and either way should to lead to a user report if there's a failure. |
My concern is that |
This code was introduced in
https://github.com/rspec/rspec-expectations/pull/220/files#diff-9533f5f156a38a3307ecfc610d2282d7R47
but is no longer raised either by the the current test code, the original test
code
@expected="Tu avec carté {count} itém has".encode('UTF-16LE')
@Actual="Tu avec carte {count} item has".encode('UTF-16LE') or any other
variations I've tried.
So, I'm proposing to remove it, especially since encoding
is well-supported and tested by EncodedString, which the Differ relies on.