From c0fa069aef7bab176697309513766cf7287ed7ba Mon Sep 17 00:00:00 2001 From: Mischa S Date: Sat, 29 Oct 2011 10:12:17 -0700 Subject: [PATCH] try pinging twice in the test --- t/10-pubsub.t | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/t/10-pubsub.t b/t/10-pubsub.t index b9508db..8c8e85a 100755 --- a/t/10-pubsub.t +++ b/t/10-pubsub.t @@ -29,17 +29,21 @@ sub run_tests { my $pub_topic = $pub_bus->topic('ping'); my $sub_topic = $sub_bus->topic('ping'); + my $ping_count = 0; my $cv = AE::cv; + $cv->begin; + $cv->begin; # subscribe my $listener = $sub_bus->new_listener($sub_topic); - $listener->poll(sub { $cv->send }); + $listener->poll(sub { $ping_count++; $cv->end }); # publish - $pub_topic->publish({ __type => 'ping', __params => { bleep => 'bloop' } }); + $pub_topic->publish({ type => 'ping', params => { bleep => 'bloop' } }); + $pub_topic->publish({ type => 'ping', params => { bleep => 'bloop' } }); $cv->recv; - ok("Got ping"); + is($ping_count, 2, "Got pings"); }