Permalink
Browse files

Spliced test into two separate (one per use option)

  • Loading branch information...
1 parent 2f4c8da commit 58c8ebe6cfbb8965e3a9f97514ae935494d5c184 Gianfranco committed Jul 5, 2011
Showing with 15 additions and 7 deletions.
  1. +15 −7 test/audit_collector_tests.erl
@@ -5,18 +5,26 @@ audit_collector_test_() ->
{foreach,
fun() -> audit_collector:start_link() end,
fun(_) -> audit_collector:stop() end,
- [fun audit_collector_process/0
+ [fun audit_collector_process_send/0,
+ fun audit_collector_process_receive/0
]}.
-audit_collector_process() ->
- audit_collector:audit(process,[send,'receive']),
+audit_collector_process_send() ->
+ audit_collector:audit(process,[send]),
Self = self(),
Sender = spawn_link(fun() -> Self ! {i_sent_this,self()} end),
- Receiver = spawn_link(fun() -> receive die -> ok end end),
receive {i_sent_this,Sender} -> ok end,
+ timer:sleep(10),
+ ?assertMatch(
+ [{send,Sender,{i_sent_this,Sender}}],
+ audit_collector:review(process,[send])).
+
+audit_collector_process_receive() ->
+ audit_collector:audit(process,['receive']),
+ Receiver = spawn_link(fun() -> receive die -> ok end end),
Receiver ! die,
timer:sleep(10),
?assertMatch(
- [{send,Sender,{i_sent_this,Sender}},
- {'receive',Receiver,die}],
- audit_collector:review(process,[send,'receive'])).
+ [{'receive',Receiver,die}],
+ audit_collector:review(process,['receive'])).
+

0 comments on commit 58c8ebe

Please sign in to comment.