b7818553ee0e17aa2ae15cd0f636a12d0c74644b
[gitmo/Mouse.git] / t / 800_shikabased / 007-multi-roles.t
1 use strict;
2 use warnings;
3 use Test::More;
4
5 plan skip_all => "Moose way 'with' function test" unless $ENV{MOUSE_DEVEL};
6 plan tests => 2;
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 {
22     package Requires2;
23     use Mouse::Role;
24     requires 'bar';
25 }
26
27 {
28     package Method2;
29     use Mouse::Role;
30
31     sub foo { 'yep' }
32 }
33
34
35 {
36     package MyApp;
37     use Mouse;
38     with ('Requires2', 'Method2' => { alias => { foo => 'bar' } }, 'Requires', 'Method');
39 }
40
41 my $m = MyApp->new;
42 is $m->foo, 'ok';
43 is $m->bar, 'yep';
44