Closed horkhe closed 11 years ago
It would be great if we could wait for a particular function of a mocked module to be called a particular number of times with particular parameters. E.g.
meck:new(some_mod, [passthrough]), .... meck:wait_4_call(3, {some_mod, f1, [blah, '_', 10]}, 10000).
where
-spec wait_4_call(CalledTimes :: non_neg_integer(), {module(), func(), args_pattern()}, Timeout :: erlang:timeout()) -> ok.
The wait_4_call should fail if the call pattern, that we are waiting upon, is not met within the time specified by Timeout.
I personally need this capability to use in my functional tests to get rid of ugly timer:sleep/1.
This is a really good idea!
Maybe we could call it wait only? (Also, timeout should be optional)
wait
I will start working on it as soon as finish splitting of the meck module.
It would be great if we could wait for a particular function of a mocked module to be called a particular number of times with particular parameters. E.g.
where
The wait_4_call should fail if the call pattern, that we are waiting upon, is not met within the time specified by Timeout.
I personally need this capability to use in my functional tests to get rid of ugly timer:sleep/1.