6 use Test::More tests => 10;
19 [ sort Foo::Role->meta->get_required_method_list ],
21 '... the Foo::Role has a required method (foo)');
23 # classes which does not implement required method
28 ::dies_ok { with('Foo::Role') } '... no foo method implemented by Foo::Class';
31 # class which does implement required method
36 ::dies_ok { with('Foo::Class') } '... cannot consume a class, it must be a role';
37 ::lives_ok { with('Foo::Role') } '... has a foo method implemented by Bar::Class';
39 sub foo { 'Bar::Class::foo' }
42 # role which does implement required method
47 ::lives_ok { with('Foo::Role') } '... has a foo method implemented by Bar::Role';
49 sub foo { 'Bar::Role::foo' }
53 [ sort Bar::Role->meta->get_required_method_list ],
55 '... the Bar::Role has not inherited the required method from Foo::Role');
57 # role which does not implement required method
62 ::lives_ok { with('Foo::Role') } '... no foo method implemented by Baz::Role';
66 [ sort Baz::Role->meta->get_required_method_list ],
68 '... the Baz::Role has inherited the required method from Foo::Role');
70 # classes which does not implement required method
75 ::dies_ok { with('Baz::Role') } '... no foo method implemented by Baz::Class2';
78 # class which does implement required method
83 ::lives_ok { with('Baz::Role') } '... has a foo method implemented by Baz::Class2';
85 sub foo { 'Baz::Class2::foo' }