Created
April 30, 2012 07:49
-
-
Save hpyhacking/2556335 to your computer and use it in GitHub Desktop.
Test Named Process in Eunit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-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(). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-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