From: Dave Rolsky Date: Thu, 17 Sep 2009 22:35:34 +0000 (-0500) Subject: Add a TODO test for a bug related to metaroles X-Git-Tag: 0.92~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=629ba32195e6dd0c57143b4b162723ec24417855;p=gitmo%2FMoose.git Add a TODO test for a bug related to metaroles --- diff --git a/t/050_metaclasses/015_metarole.t b/t/050_metaclasses/015_metarole.t index aaa89e9..5cd2dd7 100644 --- a/t/050_metaclasses/015_metarole.t +++ b/t/050_metaclasses/015_metarole.t @@ -5,7 +5,7 @@ use warnings; use lib 't/lib', 'lib'; -use Test::More tests => 89; +use Test::More tests => 91; use Test::Exception; use Moose::Util::MetaRole; @@ -628,3 +628,40 @@ lives_ok { 'method_metaclass_role applied' ); } + +{ + package Parent; + use Moose; + + Moose::Util::MetaRole::apply_metaclass_roles( + for_class => __PACKAGE__, + constructor_class_roles => ['Role::Foo'], + ); +} + +{ + package Child; + + use Moose; + extends 'Parent'; +} + +{ + ok( + Parent->meta->constructor_class->meta->can('does_role') + && Parent->meta->constructor_class->meta->does_role('Role::Foo'), + 'Parent constructor class has metarole from Parent' + ); + +TODO: + { + local $TODO + = 'Moose does not see that the child differs from the parent because it only checks the class and instance metaclasses do determine compatibility'; + ok( + Child->meta->constructor_class->meta->can('does_role') + && Child->meta->constructor_class->meta->does_role( + 'Role::Foo'), + 'Child constructor class has metarole from Parent' + ); + } +}