Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

30 lines (23 sloc) 0.549 kB
#!/usr/bin/env perl
use strict;
use Test::More 'no_plan';
{
package Counter;
use metaclass 'MooseX::POE::SweetArgs';
use MooseX::POE;
has count => (is => 'rw', default => 1);
sub START {
my ($self) = @_;
$self->yield(add => 5);
}
event add => sub {
my ($self, $n) = @_;
::is(scalar @_, 2, 'correct number of args');
::is($n, 5, 'got the right value');
$self->count( $self->count + $n );
};
no MooseX::POE;
}
my $counter = Counter->new;
POE::Kernel->run;
is($counter->count, 6, 'correct final count');
Jump to Line
Something went wrong with that request. Please try again.