You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use mockery with ginkgo. That means every mock really needs to register an AfterEach() handler to catch missed calls ASAP. It's really easy to forget to add the AfterEach().
One idea was to create a wrapper around mocks.Mock that includes a RegisterAfterEach() method. That would at least reduce boilerplate. A better solution would be to have something akin to a New() function for each mock that made the AfterEach() call while returning the new mock to you.
There's probably other solutions as well, but they all depend on being able to somehow alter the code that mockery is generating.
Does this sound like a good idea? If so, what's the best way to go about implementing it?
The text was updated successfully, but these errors were encountered:
I use mockery with ginkgo. That means every mock really needs to register an AfterEach() handler to catch missed calls ASAP. It's really easy to forget to add the AfterEach().
One idea was to create a wrapper around mocks.Mock that includes a RegisterAfterEach() method. That would at least reduce boilerplate. A better solution would be to have something akin to a New() function for each mock that made the AfterEach() call while returning the new mock to you.
There's probably other solutions as well, but they all depend on being able to somehow alter the code that mockery is generating.
Does this sound like a good idea? If so, what's the best way to go about implementing it?
The text was updated successfully, but these errors were encountered: