-
Notifications
You must be signed in to change notification settings - Fork 28
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
Overriding / Resetting stubs on a mock #78
Comments
Hi @alexlingww, I'm happy to merge both as PR. Not sure if you even need both though in your use case. |
Hi @petergtz Sorry for the really late reply. I'm personally not familiar with Mockito so I thought that was just intended behavior. Good to know we'd be fixing a bug. Awesome, will get on that when I can need to cut a bit more red tape before I can get going.
|
My team and I are currently using ginkgo/gomega in such a way that we end up stubbing out methods twice for the same input.
Currently it seems the behaviour is that
FirstReturnValue
would be returned regardless based on some poking and proddingThe use case in is that in Ginkgo my team has begun structuring our tests such that the valid case is at the top level context, while subsequent contexts are error cases or modifications of the happy path.
Example:
We've been getting around this problem by making the callback function a parameter in a helper function to construct the response, but that solution isn't ideal.
It seems either an override for the same parameters so that a second, or a reset to the mock as in Issue #15 would be ideal.
One of my teammates @jpopadak and myself are willing to work with you to implement either or both solutions.
The text was updated successfully, but these errors were encountered: