Move is_valid_class_name into XS
[gitmo/Mouse.git] / t / 001_mouse / 807-multi-roles.t
CommitLineData
2774c5e2 1use strict;
2use warnings;
a759da51 3use 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
32my $m = MyApp->new;
33is $m->foo, 'ok';
34is $m->bar, 'yep';
21498b08 35is $m->baz, 'yep';
2774c5e2 36