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/adds reset calls as optional #181

Merged
merged 22 commits into from
Mar 8, 2023

Conversation

cbaker
Copy link
Contributor

@cbaker cbaker commented Oct 25, 2022

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

#157

@cbaker cbaker changed the title Feature/adds reset calls as option Feature/adds reset calls as optional Oct 25, 2022
internal/template/template.go Outdated Show resolved Hide resolved
internal/template/template.go Outdated Show resolved Hide resolved
Copy link
Contributor

@breml breml left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest, that the README is updated as well.

@cbaker
Copy link
Contributor Author

cbaker commented Nov 12, 2022

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
Copy link
Owner

matryer commented Nov 12, 2022

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.

main.go Show resolved Hide resolved
main.go Show resolved Hide resolved
pkg/moq/moq_test.go Show resolved Hide resolved
pkg/moq/moq_test.go Show resolved Hide resolved
@cbaker
Copy link
Contributor Author

cbaker commented Nov 15, 2022

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

@cbaker cbaker requested review from breml and sudo-suhas and removed request for breml and sudo-suhas December 21, 2022 14:34
@viniciuspalma
Copy link

@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

README.md Outdated Show resolved Hide resolved
internal/template/template.go Outdated Show resolved Hide resolved
internal/template/template.go Outdated Show resolved Hide resolved
pkg/moq/testpackages/dotimport/service.go Outdated Show resolved Hide resolved
internal/template/template.go Outdated Show resolved Hide resolved
internal/template/template.go Outdated Show resolved Hide resolved
internal/template/template.go Outdated Show resolved Hide resolved
cbaker and others added 7 commits March 6, 2023 10:02
Co-authored-by: Suhas Karanth <sudo-suhas@users.noreply.github.com>
Co-authored-by: Lucas Bremgartner <breml@users.noreply.github.com>
Co-authored-by: Lucas Bremgartner <breml@users.noreply.github.com>
pkg/moq/moq_test.go Outdated Show resolved Hide resolved
pkg/moq/testpackages/withresets/withresets.go Outdated Show resolved Hide resolved
@sudo-suhas
Copy link
Collaborator

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
Copy link
Contributor Author

cbaker commented Mar 7, 2023

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
Copy link
Collaborator

a bit confused..
image

@sudo-suhas sudo-suhas merged commit d0d706b into matryer:main Mar 8, 2023
@sudo-suhas
Copy link
Collaborator

Was able to merge it from the mobile app 🤷🏼

@sudo-suhas
Copy link
Collaborator

Realease via v0.3.1 🎉

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

Successfully merging this pull request may close these issues.

6 participants