-
Notifications
You must be signed in to change notification settings - Fork 81
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
Mocking functions with optional arguments #74
Comments
You must mock both - get/1 if you calling it without arguments from code or both get/1 and get/2, if you using both variants of calling, because mocking makes module in background and defines functions which you passed to with_mock and knows nothing about module you are mocking.
|
Ok, but how mock definition would look like? Just two entries in a Keyword with the same key? Like this?
|
I don't know exactly how to do it using Mock, I personally using :meck directly. |
But I think your variant with two entries would work |
Yup, thanks guys! |
Variable amount of arguments is not allowed in lambda, how would one approach mocking a function with optional arguments then?
The text was updated successfully, but these errors were encountered: