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;
10 $TODO = q{Mouse is not yet completed};
13 use Mouse::Meta::Role::Application;
14 use Mouse::Meta::Role::Composite;
20 sub foo { 'Role::Foo::foo' }
25 sub bar { 'Role::Bar::bar' }
27 package Role::FooConflict;
30 sub foo { 'Role::FooConflict::foo' }
32 package Role::BarConflict;
35 sub bar { 'Role::BarConflict::bar' }
37 package Role::AnotherFooConflict;
39 with 'Role::FooConflict';
41 sub baz { 'Role::AnotherFooConflict::baz' }
44 # test simple attributes
46 my $c = Mouse::Meta::Role::Composite->new(
52 isa_ok($c, 'Mouse::Meta::Role::Composite');
54 is($c->name, 'Role::Foo|Role::Bar', '... got the composite role name');
57 Mouse::Meta::Role::Application->new->apply($c);
58 } '... this succeeds as expected';
61 [ sort $c->get_method_list ],
63 '... got the right list of methods'
67 # test simple conflict
69 my $c = Mouse::Meta::Role::Composite->new(
72 Role::FooConflict->meta,
75 isa_ok($c, 'Mouse::Meta::Role::Composite');
77 is($c->name, 'Role::Foo|Role::FooConflict', '... got the composite role name');
80 Mouse::Meta::Role::Application->new->apply($c);
81 } '... this succeeds as expected';
84 [ sort $c->get_method_list ],
86 '... got the right list of methods'
90 [ sort $c->get_required_method_list ],
92 '... got the right list of required methods'
96 # test complex conflict
98 my $c = Mouse::Meta::Role::Composite->new(
102 Role::FooConflict->meta,
103 Role::BarConflict->meta,
106 isa_ok($c, 'Mouse::Meta::Role::Composite');
108 is($c->name, 'Role::Foo|Role::Bar|Role::FooConflict|Role::BarConflict', '... got the composite role name');
111 Mouse::Meta::Role::Application->new->apply($c);
112 } '... this succeeds as expected';
115 [ sort $c->get_method_list ],
117 '... got the right list of methods'
121 [ sort $c->get_required_method_list ],
123 '... got the right list of required methods'
127 # test simple conflict
129 my $c = Mouse::Meta::Role::Composite->new(
132 Role::AnotherFooConflict->meta,
135 isa_ok($c, 'Mouse::Meta::Role::Composite');
137 is($c->name, 'Role::Foo|Role::AnotherFooConflict', '... got the composite role name');
140 Mouse::Meta::Role::Application->new->apply($c);
141 } '... this succeeds as expected';
144 [ sort $c->get_method_list ],
146 '... got the right list of methods'
150 [ sort $c->get_required_method_list ],
152 '... got the right list of required methods'