Skip to content
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

Feature Idea: allow customization of generated code #171

Closed
JimNasbyGE opened this issue Sep 7, 2017 · 0 comments
Closed

Feature Idea: allow customization of generated code #171

JimNasbyGE opened this issue Sep 7, 2017 · 0 comments

Comments

@JimNasbyGE
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants