Permalink
Fetching contributors…
Cannot retrieve contributors at this time
47 lines (34 sloc) 739 Bytes
#!/usr/bin/env perl
use strict; use warnings;
use Test::More tests => 6;
{
package Base;
use MooseX::POE;
sub START {
::pass('Base Start');
}
event hello => sub {
::pass('hello');
$_[KERNEL]->yield('goodbye');
};
}
{
package Extended;
use MooseX::POE;
extends 'Base';
sub START {
::pass('Extended after Start');
$_[KERNEL]->yield( 'hello' => 'world' );
}
before 'hello' => sub {
::is( $_[ARG0], 'world', 'before saw world' );
};
after 'hello' => sub {
::is( $_[ARG0], 'world', 'after saw world' );
};
event goodbye => sub {
::pass('goodbye');
};
}
my $foo = Extended->new();
POE::Kernel->run();