2 # This is automatically generated by author/import-moose-test.pl.
3 # DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!!
4 use t::lib::MooseCompat;
12 #use Mouse::Meta::Role::Application::RoleSummation;
13 use Mouse::Meta::Role::Composite;
19 sub foo { 'Role::Foo::foo' }
24 sub bar { 'Role::Bar::bar' }
26 package Role::FooConflict;
29 sub foo { 'Role::FooConflict::foo' }
31 package Role::BarConflict;
34 sub bar { 'Role::BarConflict::bar' }
36 package Role::AnotherFooConflict;
38 with 'Role::FooConflict';
40 sub baz { 'Role::AnotherFooConflict::baz' }
43 # test simple attributes
45 my $c = Mouse::Meta::Role::Composite->new(
51 isa_ok($c, 'Mouse::Meta::Role::Composite');
53 is($c->name, 'Role::Foo|Role::Bar', '... got the composite role name');
56 Mouse::Meta::Role::Application::RoleSummation->new->apply($c);
57 } '... this succeeds as expected';
60 [ sort $c->get_method_list ],
62 '... got the right list of methods'
66 # test simple conflict
68 my $c = Mouse::Meta::Role::Composite->new(
71 Role::FooConflict->meta,
74 isa_ok($c, 'Mouse::Meta::Role::Composite');
76 is($c->name, 'Role::Foo|Role::FooConflict', '... got the composite role name');
79 Mouse::Meta::Role::Application::RoleSummation->new->apply($c);
80 } '... this succeeds as expected';
83 [ sort $c->get_method_list ],
85 '... got the right list of methods'
89 [ sort $c->get_required_method_list ],
91 '... got the right list of required methods'
95 # test complex conflict
97 my $c = Mouse::Meta::Role::Composite->new(
101 Role::FooConflict->meta,
102 Role::BarConflict->meta,
105 isa_ok($c, 'Mouse::Meta::Role::Composite');
107 is($c->name, 'Role::Foo|Role::Bar|Role::FooConflict|Role::BarConflict', '... got the composite role name');
110 Mouse::Meta::Role::Application::RoleSummation->new->apply($c);
111 } '... this succeeds as expected';
114 [ sort $c->get_method_list ],
116 '... got the right list of methods'
120 [ sort $c->get_required_method_list ],
122 '... got the right list of required methods'
126 # test simple conflict
128 my $c = Mouse::Meta::Role::Composite->new(
131 Role::AnotherFooConflict->meta,
134 isa_ok($c, 'Mouse::Meta::Role::Composite');
136 is($c->name, 'Role::Foo|Role::AnotherFooConflict', '... got the composite role name');
139 Mouse::Meta::Role::Application::RoleSummation->new->apply($c);
140 } '... this succeeds as expected';
143 [ sort $c->get_method_list ],
145 '... got the right list of methods'
149 [ sort $c->get_required_method_list ],
151 '... got the right list of required methods'