-
Notifications
You must be signed in to change notification settings - Fork 377
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 feature matcher when feature throws #296
base: master
Are you sure you want to change the base?
Fix feature matcher when feature throws #296
Conversation
Thanks for contributing. I disagree with this one because if there's an exception at this level, then it's not a mismatch, but something is deeply broken and we should stop immediately. |
Well, for the toString method, you have a point. But we can't say that in general. |
I would argue that that is different, because it reports a known possible failure that is in the domain of the matcher. For generic feature matchers, it's harder to make universal decisions. If you wanted to enforce consistency, I'd rather remove the exception handling from the file matcher. What does the additional complexity handling of the exception do to improve the user's experience? |
This is really where we disagree. I believe it's a "user space" issue, instead. Not a Matcher problem. It's the same concept as throwing in matchesSafely() if the method for matching throws. |
@alb-i986 please can you rebase from master, as |
f805546
to
67452d1
Compare
Right now, that may happen in: - HasToString, if the actual object has a custom toString method which may throw - FileMatchers.aFileWithCanonicalPath and siblings
67452d1
to
97e8b93
Compare
Rebased and squashed. Ready to be merged. |
Going to try and kick start hamcrest, so if you want to get it merged, please rebase from the branch |
9bc653b
to
e9f7fc8
Compare
While working on #294 I noticed that
FeatureMatcher#featureValueOf
may throw.Right now, that may happen in:
I'm gonna squash as soon as you review.