use Test::Exception;
use Scalar::Util 'blessed';
-BEGIN {
- use_ok('Moose');
-}
+
{
}
}
-my $obj = Bar->new;
-isa_ok($obj, 'Bar');
+my $bar = Bar->new;
+isa_ok($bar, 'Bar');
my $foo = Foo->new;
+isa_ok($foo, 'Foo');
-ok(!$obj->can( 'talk' ), "... the role is not composed yet");
+ok(!$bar->can( 'talk' ), "... the role is not composed yet");
dies_ok {
- $foo->dog($obj)
-} '... and setting the accessor fails (not a Dog yet)';
+ $foo->dog($bar)
+} 'and setting the accessor fails (not a Dog yet)';
-Dog->meta->apply($obj);
+Dog->meta->apply($bar);
-ok($obj->can('talk'), "... the role is now composed at the object level");
+ok($bar->can('talk'), "... the role is now composed at the object level");
-is($obj->talk, 'woof', '... got the right return value for the newly composed method');
+is($bar->talk, 'woof', 'got the right return value for the newly composed method');
lives_ok {
- $foo->dog($obj)
-} '... and setting the accessor is okay';
+ $foo->dog($bar)
+} 'and setting the accessor is okay';