6 use Test::More tests => 7;
9 use Mouse::Meta::Role::Application::RoleSummation;
10 use Mouse::Meta::Role::Composite;
15 has 'foo' => (is => 'rw');
19 has 'bar' => (is => 'rw');
21 package Role::FooConflict;
23 has 'foo' => (is => 'rw');
25 package Role::BarConflict;
27 has 'bar' => (is => 'rw');
29 package Role::AnotherFooConflict;
31 with 'Role::FooConflict';
34 # test simple attributes
36 my $c = Mouse::Meta::Role::Composite->new(
42 isa_ok($c, 'Mouse::Meta::Role::Composite');
44 is($c->name, 'Role::Foo|Role::Bar', '... got the composite role name');
47 Mouse::Meta::Role::Application::RoleSummation->new->apply($c);
48 } '... this succeeds as expected';
51 [ sort $c->get_attribute_list ],
53 '... got the right list of attributes'
57 # test simple conflict
59 Mouse::Meta::Role::Application::RoleSummation->new->apply(
60 Mouse::Meta::Role::Composite->new(
63 Role::FooConflict->meta,
67 } '... this fails as expected';
69 # test complex conflict
71 Mouse::Meta::Role::Application::RoleSummation->new->apply(
72 Mouse::Meta::Role::Composite->new(
76 Role::FooConflict->meta,
77 Role::BarConflict->meta,
81 } '... this fails as expected';
83 # test simple conflict
85 Mouse::Meta::Role::Application::RoleSummation->new->apply(
86 Mouse::Meta::Role::Composite->new(
89 Role::AnotherFooConflict->meta,
93 } '... this fails as expected';