Skip to content

Instantly share code, notes, and snippets.

@ihumanable
Created November 23, 2021 00:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ihumanable/b720af48a35fba97738abe1b170cddd3 to your computer and use it in GitHub Desktop.
Save ihumanable/b720af48a35fba97738abe1b170cddd3 to your computer and use it in GitHub Desktop.
Multiple Mocks Example
test "something" do
with_mocks([
{
ModuleA,
[:passthrough],
function_a: fn _ -> :ok end,
function_b: fn arg ->
{:ok, arg}
end
},
{
ModuleB,
[:passthrough],
function_c: fn _ -> false end,
function_d: fn _ -> true end
}
]) do
assert Something.here()
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment