From: Jesse Luehrs Date: Tue, 8 Mar 2011 06:05:36 +0000 (-0600) Subject: enable applied_attribute X-Git-Tag: 0.14~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4fb8b2bfce62abef02df6612738d6e1a1bdb1991;p=gitmo%2FMooseX-AlwaysCoerce.git enable applied_attribute --- diff --git a/lib/MooseX/AlwaysCoerce.pm b/lib/MooseX/AlwaysCoerce.pm index e5ffeea..81a7fd3 100644 --- a/lib/MooseX/AlwaysCoerce.pm +++ b/lib/MooseX/AlwaysCoerce.pm @@ -95,8 +95,9 @@ my (undef, undef, $init_meta) = Moose::Exporter->build_import_methods( }, role_metaroles => { - # applied_attribute should be available soon, for now roles are borked - # applied_attribute => ['MooseX::AlwaysCoerce::Role::Meta::Attribute'], + (Moose->VERSION >= 1.9900 + ? (applied_attribute => ['MooseX::AlwaysCoerce::Role::Meta::Attribute']) + : ()), role => ['MooseX::AlwaysCoerce::Role::Meta::Class'], } ); diff --git a/t/03-roles.t b/t/03-roles.t index 271e79f..f3ff3ec 100644 --- a/t/03-roles.t +++ b/t/03-roles.t @@ -2,7 +2,7 @@ use strict; use warnings; -use Test::More tests => 15; +use Test::More tests => 16; use Test::Fatal; use Test::NoWarnings; @@ -43,12 +43,12 @@ use Test::NoWarnings; ok( (my $instance = MyClass->new), 'instance' ); { - local $TODO = 'waiting on Moose changes for role support'; + local $TODO = (Moose->VERSION < 1.9900 ? 'waiting on Moose changes for role support' : undef); is( exception { $instance->foo('bar'); - is $instance->foo, 3; }, undef, 'attribute coercion ran' ); + is($instance->foo, 3); } is( exception {