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 Request: Capture arguments #105

Open
spencerdcarlson opened this issue Aug 5, 2019 · 0 comments
Open

Feature Request: Capture arguments #105

spencerdcarlson opened this issue Aug 5, 2019 · 0 comments

Comments

@spencerdcarlson
Copy link

spencerdcarlson commented Aug 5, 2019

Sometimes I need to capture a mocked function's arguments and then compare them to the nth time that that function was called. It was able to accomplish this by dropping down to :meck but it would be nice if there were a helper macro / function

Workaround Example

# something called MyMockedModule.myfunc 2 times 
# and I want to make sure that the params are the same both times
[{_, {_, :myfunc, args0}, _}, {_, {_, :myfunc, args1}, _}] =
        unquote(MyMockedModule)
        |> :meck.history()

assert Map.equal?(args0, args1)
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

No branches or pull requests

1 participant