matryer / moq

Interface mocking tool for go generate
http://bit.ly/meetmoq
MIT License
1.96k stars 126 forks source link

Feature/adds reset calls as optional #181

Closed cbaker closed 1 year ago

cbaker commented 1 year ago

Adds fundamental mocking feature (reset calls) to moq behind optional flag, as requested here.

157

cbaker commented 1 year ago

Great feedback guys I've gone ahead and made the changes requested other than the function rename as I agree with @breml Should I go ahead and apply the -with-resets flag to interfaces in pkg/moq/testpackages?

matryer commented 1 year ago

thanks @cbaker - yeah @breml makes a good point. Looks like -with-resets is well tested, but happy if you want to add one in pkg/moq/testpackages.

cbaker commented 1 year ago

I believe all changes have been satisfied, checks are passing, waiting on you @matryer

viniciuspalma commented 1 year ago

@matryer @cbaker Some idea when this could become available, I have a case where I share the same mock over multiple subtests since the whole setup is complex and giant.

The reset call could help a lot in my case, to reset the calls in each run facilitating to read each call as expected, the test expects that each run call only once the stubbed method so what I do today without this feature is checking the calls lengths minus the calls from the previous test.

What is a big effort and doesn't look as an elegant solution. I would love to facilitate this change if needed.

Thanks for the great work 'til now

sudo-suhas commented 1 year ago

This branch cannot be rebased due to conflicts

changes look good but not able to merge. Could you rebase this branch on the main branch?

cbaker commented 1 year ago

This branch cannot be rebased due to conflicts

changes look good but not able to merge. Could you rebase this branch on the main branch?

Did we race on the comment vs the merge commit or does this still need to be done because it looks good on my side?

sudo-suhas commented 1 year ago

a bit confused.. image

sudo-suhas commented 1 year ago

Was able to merge it from the mobile app 🤷🏼

sudo-suhas commented 1 year ago

Realease via v0.3.1 🎉