6 use Test::More tests => 10;
20 [ sort Foo::Role->meta->get_required_method_list ],
22 '... the Foo::Role has a required method (foo)'
25 # classes which does not implement required method
31 ::dies_ok { with('Foo::Role') }
32 '... no foo method implemented by Foo::Class';
35 # class which does implement required method
41 ::dies_ok { with('Foo::Class') }
42 '... cannot consume a class, it must be a role';
43 ::lives_ok { with('Foo::Role') }
44 '... has a foo method implemented by Bar::Class';
46 sub foo {'Bar::Class::foo'}
49 # role which does implement required method
55 ::lives_ok { with('Foo::Role') }
56 '... has a foo method implemented by Bar::Role';
58 sub foo {'Bar::Role::foo'}
62 [ sort Bar::Role->meta->get_required_method_list ],
64 '... the Bar::Role has not inherited the required method from Foo::Role'
67 # role which does not implement required method
73 ::lives_ok { with('Foo::Role') }
74 '... 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'
83 # classes which does not implement required method
89 ::dies_ok { with('Baz::Role') }
90 '... no foo method implemented by Baz::Class2';
93 # class which does implement required method
99 ::lives_ok { with('Baz::Role') }
100 '... has a foo method implemented by Baz::Class2';
102 sub foo {'Baz::Class2::foo'}