6 use Test::More tests => 11;
23 [ sort Foo::Role->meta->get_required_method_list ],
25 '... the Foo::Role has a required method (foo)');
27 # classes which does not implement required method
34 ::dies_ok { with('Foo::Role') } '... no foo method implemented by Foo::Class';
37 # class which does implement required method
44 ::dies_ok { with('Foo::Class') } '... cannot consume a class, it must be a role';
45 ::lives_ok { with('Foo::Role') } '... has a foo method implemented by Bar::Class';
47 sub foo { 'Bar::Class::foo' }
50 # role which does implement required method
57 ::lives_ok { with('Foo::Role') } '... has a foo method implemented by Bar::Role';
59 sub foo { 'Bar::Role::foo' }
63 [ sort Bar::Role->meta->get_required_method_list ],
65 '... the Bar::Role has not inherited the required method from Foo::Role');
67 # role which does not implement required method
74 ::lives_ok { with('Foo::Role') } '... no foo method implemented by Baz::Role';
78 [ sort Baz::Role->meta->get_required_method_list ],
80 '... the Baz::Role has inherited the required method from Foo::Role');
82 # classes which does not implement required method
89 ::dies_ok { with('Baz::Role') } '... no foo method implemented by Baz::Class2';
92 # class which does implement required method
99 ::lives_ok { with('Baz::Role') } '... has a foo method implemented by Baz::Class2';
101 sub foo { 'Baz::Class2::foo' }