Open Juliusan opened 2 years ago
Adding the non_strict
flag makes the test above pass:
meck_delete_test() ->
ok = meck:new(some_module, [passthrough, non_strict]),
?assert(erlang:function_exported(some_module, some_function, 2)),
ok = meck:delete(some_module, some_function, 2, true),
?assertNot(erlang:function_exported(some_module, some_function, 2)),
?assert(meck:validate([some_module])),
ok = meck:unload([some_module]).
I'm not sure about the exact semantics of combining passthrough
with non_strict
to know if this was a hidden "feature", or if this brings new problems. But this seems to work, at least, as a workaround.
It was possible to delete the function, that is implemented, using
meck:delete
in version 0.9.0, however in 0.9.1 this throws an error.Reproduction Steps
Expected behavior
This test should pass:
Observed behavior
The test fails, indicating that second call to
function_exported
is still true.Versions