Commit | Line | Data |
---|---|---|
2774c5e2 | 1 | use strict; |
2 | use warnings; | |
a759da51 | 3 | use Test::More tests => 3; |
2774c5e2 | 4 | |
5 | { | |
6 | package Requires; | |
7 | use Mouse::Role; | |
8 | requires 'foo'; | |
9 | } | |
10 | ||
11 | { | |
12 | package Method; | |
13 | use Mouse::Role; | |
14 | ||
15 | sub foo { 'ok' } | |
16 | } | |
17 | ||
18 | { | |
2774c5e2 | 19 | package Method2; |
20 | use Mouse::Role; | |
21 | ||
21498b08 | 22 | sub bar { 'yep' } |
2774c5e2 | 23 | } |
24 | ||
2774c5e2 | 25 | { |
26 | package MyApp; | |
27 | use Mouse; | |
21498b08 | 28 | with ('Requires', 'Method'); |
29 | with ('Method2' => { alias => { bar => 'baz' } }); | |
2774c5e2 | 30 | } |
31 | ||
32 | my $m = MyApp->new; | |
33 | is $m->foo, 'ok'; | |
34 | is $m->bar, 'yep'; | |
21498b08 | 35 | is $m->baz, 'yep'; |
2774c5e2 | 36 |