33 with qw( Role::A Role::B );
59 for my $thing ( 'Foo', Foo->new, 'Foo::Child', Foo::Child->new ) {
60 my $name = ref $thing ? (ref $thing) . ' object' : "$thing class";
61 $name .= ' (immutable)' if $thing->meta->is_immutable;
64 !$thing->does('Role::A'),
65 "$name does not do Role::A"
68 !$thing->does('Role::B'),
69 "$name does not do Role::B"
73 !$thing->does( Role::A->meta ),
74 "$name does not do Role::A (passed as object)"
77 !$thing->does( Role::B->meta ),
78 "$name does not do Role::B (passed as object)"
82 !$thing->DOES('Role::A'),
83 "$name does not do Role::A (using DOES)"
86 !$thing->DOES('Role::B'),
87 "$name does not do Role::B (using DOES)"
91 for my $thing ( 'Bar', Bar->new, 'Bar::Child', Bar::Child->new ) {
92 my $name = ref $thing ? (ref $thing) . ' object' : "$thing class";
93 $name .= ' (immutable)' if $thing->meta->is_immutable;
96 $thing->does('Role::A'),
100 !$thing->does('Role::B'),
101 "$name does not do Role::B"
105 $thing->does( Role::A->meta ),
106 "$name does Role::A (passed as object)"
109 !$thing->does( Role::B->meta ),
110 "$name does not do Role::B (passed as object)"
114 $thing->DOES('Role::A'),
115 "$name does Role::A (using DOES)"
118 !$thing->DOES('Role::B'),
119 "$name does not do Role::B (using DOES)"
123 for my $thing ( 'Baz', Baz->new, 'Baz::Child', Baz::Child->new ) {
124 my $name = ref $thing ? (ref $thing) . ' object' : "$thing class";
125 $name .= ' (immutable)' if $thing->meta->is_immutable;
128 $thing->does('Role::A'),
132 $thing->does('Role::B'),
137 $thing->does( Role::A->meta ),
138 "$name does Role::A (passed as object)"
141 $thing->does( Role::B->meta ),
142 "$name does Role::B (passed as object)"
146 $thing->DOES('Role::A'),
147 "$name does Role::A (using DOES)"
150 $thing->DOES('Role::B'),
151 "$name does Role::B (using DOES)"
156 qw( Foo Bar Baz Foo::Child Bar::Child Baz::Child );