Skip to content

Instantly share code, notes, and snippets.

@chreke
Created December 5, 2012 21:48
Show Gist options
  • Save chreke/4219802 to your computer and use it in GitHub Desktop.
Save chreke/4219802 to your computer and use it in GitHub Desktop.
Eunit and Meck test skeleton
foo_tests() ->
{foreach,
fun setup/0,
fun teardown/1,
[{"Should do something",
do_something()}]}.
setup() ->
Mods = [foo, bar],
meck:new(Mods),
meck:expect(foo, do_something_else, 2, "Some return value"),
Mods.
teardown(Mods) ->
meck:unload(Mods).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment