The documentation for with
says it looks like this:
{with, X::any(), [AbstractTestFun::((any()) -> any())]}
but meck uses it like this (simplified):
meck_test_() ->
{foreach, fun setup/0, fun teardown/1,
[{with, [T]} || T <- [fun new_/1, fun unload_/1]]}.
These don’t agree…?
The meck usage expands to something like this:
{foreach, fun setup/0, fun teardown/1,
[
{with, [fun new_/1]},
{with, [fun unload_/1]}
]}.
But I’ve also managed to (seemingly) get it to work as follows:
{foreach, fun setup/0, fun teardown/1, [
{with, [fun new_/1, fun unload_/1]}
]}.
I’ve tried a couple of other variations, but I always end up with a “bad generator” error.
Are there any good examples of how to use with
?