From: 大沢 和宏 Date: Thu, 4 Dec 2008 07:54:01 +0000 (+0000) Subject: add mluti option with test X-Git-Tag: 0.19~136^2~45 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2774c5e29fa932cd93a3eacab574571035e86ade;p=gitmo%2FMouse.git add mluti option with test --- diff --git a/t/800_shikabased/007-multi-roles.t b/t/800_shikabased/007-multi-roles.t new file mode 100644 index 0000000..b781855 --- /dev/null +++ b/t/800_shikabased/007-multi-roles.t @@ -0,0 +1,44 @@ +use strict; +use warnings; +use Test::More; + +plan skip_all => "Moose way 'with' function test" unless $ENV{MOUSE_DEVEL}; +plan tests => 2; + +{ + package Requires; + use Mouse::Role; + requires 'foo'; +} + +{ + package Method; + use Mouse::Role; + + sub foo { 'ok' } +} + +{ + package Requires2; + use Mouse::Role; + requires 'bar'; +} + +{ + package Method2; + use Mouse::Role; + + sub foo { 'yep' } +} + + +{ + package MyApp; + use Mouse; + with ('Requires2', 'Method2' => { alias => { foo => 'bar' } }, 'Requires', 'Method'); +} + +my $m = MyApp->new; +is $m->foo, 'ok'; +is $m->bar, 'yep'; +