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

Add a Calls() method for call arg history #36

Merged
merged 3 commits into from
May 30, 2019
Merged

Add a Calls() method for call arg history #36

merged 3 commits into from
May 30, 2019

Conversation

Kangaroux
Copy link
Contributor

This adds a Calls() method to the method mock object which returns a list of arguments the method was called with.

  • Calls() is guaranteed to never return nil (will return an empty list if no calls are made)
  • Methods which accept no arguments do not track their call params nor is there a Calls() method generated

@Kangaroux
Copy link
Contributor Author

I didn't include it as part of the PR but I did test the case where a method has no arguments. If you create a new interface with a no-arg method and generate a mock for it, you can verify that there is no reference to callArgs or a Calls() method

template.go Show resolved Hide resolved
template.go Outdated Show resolved Hide resolved
@jesseroux
Copy link

@hexdigest Pushed changes

@hexdigest hexdigest merged commit 3993510 into gojuno:master May 30, 2019
@hexdigest
Copy link
Collaborator

Thanks @Kangaroux !
I'll tag it and release a new version soon.

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.

3 participants