-
Notifications
You must be signed in to change notification settings - Fork 91
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
fix intercept for AssertionError #683
Conversation
When trying to `intercept`and `AssertionError` till now the test passed successfully. This fix treats the FailException special.
Is there a reason that this pull request hasn't been merged, yet ? |
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.
Sorry! I wasn't super sure about the changes and was hoping for someone more knowledgeable to come by. I double checked and rethought the PR to offer some suggestions.
if !T.runtimeClass.isAssignableFrom(e.getClass()) || | ||
e.getMessage.contains(expectedExceptionMsg) => |
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.
maybe a separate case:
```suggestion
case failed: FailException if failed.getMessage() == expectedExceptionMsg =>
throw e
to be super sure? So that we only employ this logic if someone throws exactly the same error as we would. Then they're on their own
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.
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.
I totally forgot about this, @mzuehlke what do you think about suggested changes? I am ok also merging as is, we could update the test case though.
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.
I had forgotten about it, too. Sorry for that.
I adopted your suggestion.
Co-authored-by: Tomasz Godzik <[email protected]>
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.
LGTM!
When trying to
intercept
anAssertionError
till now the test passed successfully.This fix treats the FailException special.
closes: #679