Skip to content

Commit

Permalink
try pinging twice in the test
Browse files Browse the repository at this point in the history
  • Loading branch information
revmischa committed Oct 29, 2011
1 parent 094b548 commit c0fa069
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions t/10-pubsub.t
Expand Up @@ -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");
}


Expand Down

0 comments on commit c0fa069

Please sign in to comment.