6 use Test::More tests => 11;
21 [ sort Foo::Role->meta->get_required_method_list ],
23 '... the Foo::Role has a required method (foo)');
25 # classes which does not implement required method
30 ::dies_ok { with('Foo::Role') } '... no foo method implemented by Foo::Class';
33 # class which does implement required method
38 ::dies_ok { with('Foo::Class') } '... cannot consume a class, it must be a role';
39 ::lives_ok { with('Foo::Role') } '... has a foo method implemented by Bar::Class';
41 sub foo { 'Bar::Class::foo' }
44 # role which does implement required method
49 ::lives_ok { with('Foo::Role') } '... has a foo method implemented by Bar::Role';
51 sub foo { 'Bar::Role::foo' }
55 [ sort Bar::Role->meta->get_required_method_list ],
57 '... the Bar::Role has not inherited the required method from Foo::Role');
59 # role which does not implement required method
64 ::lives_ok { with('Foo::Role') } '... no foo method implemented by Baz::Role';
68 [ sort Baz::Role->meta->get_required_method_list ],
70 '... the Baz::Role has inherited the required method from Foo::Role');
72 # classes which does not implement required method
77 ::dies_ok { with('Baz::Role') } '... no foo method implemented by Baz::Class2';
80 # class which does implement required method
85 ::lives_ok { with('Baz::Role') } '... has a foo method implemented by Baz::Class2';
87 sub foo { 'Baz::Class2::foo' }