1 use lib 'lib', 't/role-basic/lib';
6 package My::Does::Basic;
10 requires 'turbo_charger';
13 return "My::Does::Basic::conflict";
18 package My::Bad::Requirement;
20 with 'My::Does::Basic'; # requires turbo_charger
23 qr/missing turbo_charger/,
24 'Trying to use a role without providing required methods should fail';
32 eval <<' END_PACKAGE';
33 package My::Bad::MethodConflicts;
35 with qw(My::Does::Basic My::Conflict);
40 'Trying to use multiple roles with the same method should fail';
48 requires 'missing_method';
49 sub method1 { 'method1' }
55 sub method2 { 'method2' }
58 package My::Class::Missing1;
63 qr/missing missing_method/,
64 'Roles composed from roles should propogate requirements upwards';
70 requires qw(this that);
73 package My::Class::Missing2;
78 qr/missing this, that/,
79 'Roles should be able to require multiple methods';