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