Skip to content

Commit

Permalink
Added "Watching for published values" test.
Browse files Browse the repository at this point in the history
 * Added a test "Watching for published values" which validates that one and
   only one invocation happens per watcher added for a value which is already
   published.
 * This test proved to not uncover any bug, which was partially expected, but
   now it's verified.
  • Loading branch information
ssmccoy committed Sep 12, 2012
1 parent 9b3fe1b commit 7cf44d6
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions t/01_watcher.t
Expand Up @@ -70,6 +70,30 @@ subtest "Add Watcher" => sub {
$blackboard->put(foo => "foo", bar => "bar");
};

=item Watching for published values.
Establish whether or not duplicate dispatches occur when looking for values
that already are published to the blackboard.
=cut

subtest "Watching for published values." => sub {
plan tests => 3;

my $blackboard = AnyEvent::Blackboard->new();
my $okayer = okayer->new(
foo => "foo",
bar => "bar",
);

$blackboard->put(foo => "foo");
$blackboard->put(bar => "bar");

$blackboard->watch([qw( foo bar )], [ $okayer, "foobar" ]);
$blackboard->watch(foo => [ $okayer, "foo" ]);
$blackboard->watch(bar => [ $okayer, "bar" ]);
};


=item Default Timeout
Expand Down

0 comments on commit 7cf44d6

Please sign in to comment.