Closed amilkr closed 4 years ago
I think you can call :meck.num_calls
and check that the number is 0.
If you want to create a wrapper for it called assert_not_called
, that'd be great!
Thanks for the answer. I'll try that.
If I find some free time, I'll try to add the macro into mock.ex
and open a PR.
In the same way as
assert_called
validates that a function was called,assert_not_called
would validate that a function was not called.If there's already a way to achieve this, please let me know :)
This would be useful, for example, in cases where you're mocking a service that sends notifications to the users and you want to validate that in some particular cases the system doesn't try to send notifications.