Closed zsoci closed 3 years ago
Seems whe using passthrough the ExistingClauses already contains the passthrough and when adding the new clause it will be added after the existing one, so the passthroguh will always be found first and used, regardless of what the new clause tells. PR issued https://github.com/eproxus/meck/pull/216
Well, the order of the expectation shall not be changed. A workaround is, when passthrough used with merge_expects, that after the meck:new(mod, fun, [passthrough, merge_expects]) call, a meck:delete(mod, fun, Arity, true) shall be called with all the arities that fun have in the mod and to be mocked. This cleans up the expectation set by the passthrough flag.
bad() ->
ok = meck:new(mtest, [passthrough, merge_expects]),
ok = meck:delete(mtest, fun_to_meck, 1, true),
run_test().
version meck─0.9.0 (hex package)
It seems when merge_expects is used together with passthrough that will somehow not get handled. Alone, merge_expects works.