14 sub foo { 'Foo::foo' }
15 sub bar { 'Foo::bar' }
16 sub baz { 'Foo::baz' }
17 sub gorch { 'Foo::gorch' }
22 sub foo { 'Bar::foo' }
23 sub bar { 'Bar::bar' }
24 sub baz { 'Bar::baz' }
25 sub gorch { 'Bar::gorch' }
30 sub foo { 'Baz::foo' }
31 sub bar { 'Baz::bar' }
32 sub baz { 'Baz::baz' }
33 sub gorch { 'Baz::gorch' }
38 sub foo { 'Gorch::foo' }
39 sub bar { 'Gorch::bar' }
40 sub baz { 'Gorch::baz' }
41 sub gorch { 'Gorch::gorch' }
49 with 'Foo' => { -excludes => [qw/bar baz gorch/], -alias => { gorch => 'foo_gorch' } },
50 'Bar' => { -excludes => [qw/foo baz gorch/] },
51 'Baz' => { -excludes => [qw/foo bar gorch/], -alias => { foo => 'baz_foo', bar => 'baz_bar' } },
52 'Gorch' => { -excludes => [qw/foo bar baz/] };
53 }, undef, '... everything works out all right' );
56 my $c = My::Class->new;
57 isa_ok($c, 'My::Class');
59 is($c->foo, 'Foo::foo', '... got the right method');
60 is($c->bar, 'Bar::bar', '... got the right method');
61 is($c->baz, 'Baz::baz', '... got the right method');
62 is($c->gorch, 'Gorch::gorch', '... got the right method');
64 is($c->foo_gorch, 'Foo::gorch', '... got the right method');
65 is($c->baz_foo, 'Baz::foo', '... got the right method');
66 is($c->baz_bar, 'Baz::bar', '... got the right method');
73 sub baz { 'Splunk::baz' }
74 sub gorch { 'Splunk::gorch' }
76 ::is(::exception { with 'Foo' }, undef, 'role to role application works');
82 ::is(::exception { with 'Splunk' }, undef, 'and the role can be consumed');
85 is(My::Class2->foo, 'Foo::foo', '... got the right method');
86 is(My::Class2->bar, 'Foo::bar', '... got the right method');
87 is(My::Class2->baz, 'Splunk::baz', '... got the right method');
88 is(My::Class2->gorch, 'Splunk::gorch', '... got the right method');