-
Notifications
You must be signed in to change notification settings - Fork 116
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
Generate typed Times for mocks #55
Comments
I'm not really sure what kind of benefit this brings. Could you explain more in detail why this feature is needed? |
Sure, I'll give it a go 😄 As I understand it, gomock does method chaining. Given the example in the README, these two snippets should produce the same result: m.
EXPECT().
Bar(gomock.Eq(101)).
Return(103). // Return first
Times(1) // Times last m.
EXPECT().
Bar(gomock.Eq(101)).
Times(1). // Times first
Return(103) // Return last If this is all wrong then let me know! 😅 Running gomock with the While using the first snippet above will help me ( Of course, I could just rewrite the test to always run It's worth noting that if |
Thanks for the detailed explanation! I'll bring this up to the team. |
Requested feature
Generate typed
Times()
, just asReturn
,Do
andDoAndReturn
Why the feature is needed
I would like both of these cases supported:
(Optional) Proposed solution:
I added
Times
to be emitted by mockgen in my repository forkThe text was updated successfully, but these errors were encountered: