From: Shawn M Moore Date: Sun, 7 Dec 2008 02:11:54 +0000 (+0000) Subject: Apply the parameterizable role to the parameterized role 8) X-Git-Tag: 0.05~43 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=563f6b7c1d36e1c1efdc79330f95c034ec9bc0d1;p=gitmo%2FMooseX-Role-Parameterized.git Apply the parameterizable role to the parameterized role 8) --- diff --git a/lib/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm b/lib/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm index f76f296..c9f1553 100644 --- a/lib/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm +++ b/lib/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm @@ -61,6 +61,9 @@ sub generate_role { my $role = $self->parameterized_role_metaclass->create_anon_role(parameters => $parameters); local $MooseX::Role::Parameterized::CURRENT_METACLASS = $role; + + $self->apply_parameterized_role($role); + $self->role_generator->($parameters, operating_on => $role, ); @@ -77,6 +80,12 @@ sub apply { $role->apply($class, %args); } +sub apply_parameterized_role { + my $self = shift; + + $self->SUPER::apply(@_); +} + __PACKAGE__->meta->make_immutable; no Moose; diff --git a/t/013-does.t b/t/013-does.t index c7132c5..87660d3 100644 --- a/t/013-does.t +++ b/t/013-does.t @@ -2,8 +2,7 @@ use strict; use warnings; -#use Test::More tests => 3; -use Test::More skip_all => 'TODO'; +use Test::More tests => 3; use Test::Moose; { @@ -24,7 +23,7 @@ does_ok( 'MyClass', 'MyPRole', 'class does the parameterized role' ); cmp_ok( $generated_role->meta->get_roles->[0]->name, 'eq', - 'MyProle', + 'MyPRole', 'generated role does the parameterized role' );