elixir_mock icon indicating copy to clipboard operation
elixir_mock copied to clipboard

Add "was called with any number of arguments" verification

Open wanderanimrod opened this issue 8 years ago • 0 comments

Currently,

if I want to verify that a function with arity 3 was called but I don't care about the number of args, I still have to say

import Mockex.Matchers

assert_called mock.function(any(), any(), any())

Suggestion

import Mockex.Matchers

assert_called mock.function, :any_args

# OR for consistency with other matchers

assert_called mock.function(any_number_of_args())

We can't simply use assert_called mock.function because it means "assert called with no args"

wanderanimrod avatar Jun 17 '17 03:06 wanderanimrod