-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
A useful pattern is to have a function take a thing that doesn't implement an interface and return anotherThing 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?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels