-
Notifications
You must be signed in to change notification settings - Fork 54
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
raise_error + an exception object produces wrong failure message #94
Comments
Hello @mcmire, maybe I bumped into this one (or a very similar one) today too: expect { raise 'x' }.to raise_error(start_with('x')) #=> true
expect { raise 'x' }.to raise_error(start_with('y'))
NoMethodError: undefined method `name' for #<RSpec::Matchers::BuiltIn::StartWith:0x63306e58>
from .../gems/super_diff-0.5.2/lib/super_diff/rspec/monkey_patches.rb:668:in `expected_for_matcher_text' How can I help fixing it? |
I think that might be technically a different issue, but I guess it's the same message so perhaps it's related. That is happening because |
Ok, so I'm thinking, would it be better to add support for |
Yeah, it might be a good idea to fall back if there is an error. There's an issue I made in #44 around this, so I've been thinking about doing this anyway (probably should have done it all this time). I don't have a ton of time these days so I'm not sure if I could get to either one soon, but falling back is probably a good strategy overall regardless. |
This may be fixed already, but the gem raises an error on this line when you attempt to use
raise_error
with a single exception object and the matcher fails:https://github.com/mcmire/super_diff/blob/master/lib/super_diff/rspec/monkey_patches.rb#L664
(undefined method
name
for SomeExceptionClass)The text was updated successfully, but these errors were encountered: