From: Dagfinn Ilmari Mannsåker Date: Tue, 30 Oct 2012 15:46:46 +0000 (+0000) Subject: Add TODO test for RT#80492 X-Git-Tag: v1.000007~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=53c748970ae4ae86d8e215b9e46b93b7ac024536;p=gitmo%2FMoo.git Add TODO test for RT#80492 --- diff --git a/xt/moose-does-moo-role.t b/xt/moose-does-moo-role.t index 2e84eb6..e9c89db 100644 --- a/xt/moose-does-moo-role.t +++ b/xt/moose-does-moo-role.t @@ -5,8 +5,14 @@ use Test::Exception; use Moo::HandleMoose; { + package MooParentRole; + use Moo::Role; + sub parent_role_method { 1 }; + package MooRole; use Moo::Role; + with 'MooParentRole'; + sub role_method { 1 }; package MooRoledMooClass; use Moo; @@ -37,10 +43,14 @@ use Moo::HandleMoose; for my $parent (qw(MooseParent MooParent)) { for my $child (qw(MooRoledMooClass MooRoledMooseClass)) { - lives_ok { - $parent->new( + lives_and { + my $o = $parent->new( e => $child->new(), ); + ok( $o->e->does("MooParentRole"), "$child does parent MooRole" ); + can_ok( $o->e, "role_method" ); + local $TODO = "multi-level roles are broken with moose" if $child eq "MooRoledMooseClass"; + can_ok( $o->e, "parent_role_method" ); } "$parent instantiated with a $child delegate that does a MooRole"; } }