Skip to content

Instantly share code, notes, and snippets.

@hpyhacking
Created April 30, 2012 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hpyhacking/2556335 to your computer and use it in GitHub Desktop.
Save hpyhacking/2556335 to your computer and use it in GitHub Desktop.
Test Named Process in Eunit
-module(xxx_sup_spawn_test).
-include_lib("eunit/include/eunit.hrl").
test_1_() -> {spawn, {
setup,
fun setup/0,
[
?_assert(is_pid(whereis(xxx_sup))),
]
}}.
test_2_() -> {spawn,{
setup,
fun setup/0,
[
?_assert(is_pid(whereis(xxx_monitor))),
]
}}.
setup() ->
xxx_sup:start_link().
-module(xxx_sup_test).
-include_lib("eunit/include/eunit.hrl").
test_1() ->
{ok, _} = xxx_sup:start_link(),
?assert(is_pid(whereis(xxx_sup))).
test_2() ->
{ok, _} = xxx_sup:start_link(),
?assert(is_pid(whereis(xxx_sup))).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment