-
Notifications
You must be signed in to change notification settings - Fork 7
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
Implement Testify custom matchers via mock.MatchedBy #6
Comments
Although I haven't used the testify library, I do not think we could use e.g.
The mock.MatchedBy would then need to use the interface instead of the empty interface:
would become
With that you can then write:
... but until The other option is to make the
so you could write something like:
-- not sure that would work though as I haven't tested it. |
At least would be nice to have the public if func MatchedBy(fn interface{}) Matcher and internally in the if matcher, ok := expected.(argumentMatcher); ok {
.....
} becomes more like: if matcher, ok := expected.(Matcher); ok {
.....
} then we can create custom matchers implementing the |
Hi, I saw the recent gomock discussion and would love documentation on how to Implement Testify's custom matchers via mock.MatchedBy using this library.
The text was updated successfully, but these errors were encountered: