6 use Test::More tests => 12;
8 use Scalar::Util 'blessed';
39 ok(!$obj->can( 'talk' ), "... the role is not composed yet");
40 ok(!$obj->can( 'fur' ), 'ditto');
41 ok(!$obj->does('Dog'), '... we do not do any roles yet');
45 } '... and setting the accessor fails (not a Dog yet)';
47 Dog->meta->apply($obj);
49 ok($obj->does('Dog'), '... we now do the Bark role');
50 ok($obj->can('talk'), "... the role is now composed at the object level");
51 ok($obj->can('fur'), "it has fur");
53 is($obj->talk, 'woof', '... got the right return value for the newly composed method');
57 } '... and setting the accessor is okay';
59 is($obj->fur, "dirty", "role attr initialized");