-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
NotImplements #1065
Comments
i would also love to see |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A useful pattern is to have a function take a
thing
that doesn't implement an interface and returnanotherThing
that does. These glue functions work really well to connect different parts of an application, and create a useful abstraction across interfaces.The way I test these functions is with
assert.Implements(t, interface, anotherThing)
on the result of the function, and_, ok := thing.(interface); assert.False(ok)
on the input for good measure.It would be oh so convenient if there were an
assert.NotImplements(t, interface, thing)
I could run instead, and it would be fairly trivial to add to the API as it stands. If this isn't the kind of change that's likely to happen, is there a more semantically reasonable way of doing this?The text was updated successfully, but these errors were encountered: