add with qw( Role1 Role2 ) support
[gitmo/Mouse.git] / t / 800_shikabased / 007-multi-roles.t
CommitLineData
2774c5e2 1use strict;
2use warnings;
3use Test::More;
4
5plan skip_all => "Moose way 'with' function test" unless $ENV{MOUSE_DEVEL};
21498b08 6plan tests => 3;
2774c5e2 7
8{
9 package Requires;
10 use Mouse::Role;
11 requires 'foo';
12}
13
14{
15 package Method;
16 use Mouse::Role;
17
18 sub foo { 'ok' }
19}
20
21{
2774c5e2 22 package Method2;
23 use Mouse::Role;
24
21498b08 25 sub bar { 'yep' }
2774c5e2 26}
27
2774c5e2 28{
29 package MyApp;
30 use Mouse;
21498b08 31 with ('Requires', 'Method');
32 with ('Method2' => { alias => { bar => 'baz' } });
2774c5e2 33}
34
35my $m = MyApp->new;
36is $m->foo, 'ok';
37is $m->bar, 'yep';
21498b08 38is $m->baz, 'yep';
2774c5e2 39