1use strict; 2use warnings; 3use Test::More tests => 3; 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{ 19 package Method2; 20 use Mouse::Role; 21 22 sub bar { 'yep' } 23} 24 25{ 26 package MyApp; 27 use Mouse; 28 with ('Requires', 'Method'); 29 with ('Method2' => { -alias => { bar => 'baz' } }); 30} 31 32my $m = MyApp->new; 33is $m->foo, 'ok'; 34is $m->bar, 'yep'; 35is $m->baz, 'yep'; 36 37