From: Tomas Doran Date: Mon, 21 May 2012 07:48:40 +0000 (+0100) Subject: Role combination bug with with Moo & Moose roles X-Git-Tag: v0.091008~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=981402b80b3684c76e20952faf86406f47a2b8f0;p=gitmo%2FMoo.git Role combination bug with with Moo & Moose roles The methods which come from the Moose Role do not appear to be composed onto the package if the Moose Role is consumed in combination with a Moo::Role --- diff --git a/xt/moo-does-moose-role.t b/xt/moo-does-moose-role.t index 9f5c25d..c8be09d 100644 --- a/xt/moo-does-moose-role.t +++ b/xt/moo-does-moose-role.t @@ -2,6 +2,12 @@ use strictures 1; use Test::More; BEGIN { + package Ker; + + use Moo::Role; +} + +BEGIN { package Splat; use Moose::Role; @@ -57,7 +63,32 @@ BEGIN { sub jab { 3 } } -foreach my $s (Splattered->new, Splattered2->new) { +BEGIN { + package Ker::Splattered; + + use Moo; + + sub monkey { 'WHAT' } + + with qw/ Ker Splat /; + + sub jab { 3 } +} + +BEGIN { + package Ker::Splattered2; + + use Moo; + + sub monkey { 'WHAT' } + + with qw/ Ker Splat2 /; + + sub jab { 3 } +} + + +foreach my $s (Splattered->new, Splattered2->new, Ker::Splattered->new, Ker::Splattered2->new) { is($s->punch, 1, 'punch'); is($s->jab, 3, 'jab'); is($s->monkey, 'OW', 'monkey');