Skip to content

Instantly share code, notes, and snippets.

@ihumanable
Created November 23, 2021 00:34
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/04da2e16597faa6559fd3452c19312d4 to your computer and use it in GitHub Desktop.
Save ihumanable/04da2e16597faa6559fd3452c19312d4 to your computer and use it in GitHub Desktop.
Patch Example
test "something" do
patch(ModuleA, :function_a, :ok)
patch(ModuleA, :function_b, fn arg -> {:ok, arg} end)
patch(ModuleB, :function_c, false)
patch(ModuleB, :function_d, true)
assert Something.here()
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment