3 use lib 'lib', 't/role-basic/lib';
8 package My::Does::Basic;
12 requires 'turbo_charger';
15 return "My::Does::Basic::conflict";
20 package My::Bad::Requirement;
22 with 'My::Does::Basic'; # requires turbo_charger
25 qr/missing turbo_charger/,
26 'Trying to use a role without providing required methods should fail';
34 eval <<' END_PACKAGE';
35 package My::Bad::MethodConflicts;
37 with qw(My::Does::Basic My::Conflict);
42 'Trying to use multiple roles with the same method should fail';
50 requires 'missing_method';
51 sub method1 { 'method1' }
57 sub method2 { 'method2' }
60 package My::Class::Missing1;
65 qr/missing missing_method/,
66 'Roles composed from roles should propogate requirements upwards';
72 requires qw(this that);
75 package My::Class::Missing2;
80 qr/missing this, that/,
81 'Roles should be able to require multiple methods';