6 use Test::More no_plan => 1;
11 use_ok('Moose::Meta::Role::Application::RoleSummation');
12 use_ok('Moose::Meta::Role::Composite');
18 has 'foo' => (is => 'rw');
22 has 'bar' => (is => 'rw');
24 package Role::FooConflict;
26 has 'foo' => (is => 'rw');
28 package Role::BarConflict;
30 has 'bar' => (is => 'rw');
32 package Role::AnotherFooConflict;
34 with 'Role::FooConflict';
37 # test simple attributes
39 my $c = Moose::Meta::Role::Composite->new(
45 isa_ok($c, 'Moose::Meta::Role::Composite');
47 is($c->name, 'Role::Foo|Role::Bar', '... got the composite role name');
50 Moose::Meta::Role::Application::RoleSummation->new->apply($c);
51 } '... this succeeds as expected';
54 [ sort $c->get_attribute_list ],
56 '... got the right list of attributes'
60 # test simple conflict
62 Moose::Meta::Role::Application::RoleSummation->new->apply(
63 Moose::Meta::Role::Composite->new(
66 Role::FooConflict->meta,
70 } '... this fails as expected';
72 # test complex conflict
74 Moose::Meta::Role::Application::RoleSummation->new->apply(
75 Moose::Meta::Role::Composite->new(
79 Role::FooConflict->meta,
80 Role::BarConflict->meta,
84 } '... this fails as expected';
86 # test simple conflict
88 Moose::Meta::Role::Application::RoleSummation->new->apply(
89 Moose::Meta::Role::Composite->new(
92 Role::AnotherFooConflict->meta,
96 } '... this fails as expected';