From: Hans Dieter Pearcey Date: Thu, 12 Mar 2009 04:03:27 +0000 (-0400) Subject: lazy_build should be able to be added in inherited attributes X-Git-Tag: 0.72_01~74^2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=449559bf0ca487d0522df7b3cf32e07c16f66ee8;p=gitmo%2FMoose.git lazy_build should be able to be added in inherited attributes --- diff --git a/lib/Moose/Meta/Attribute.pm b/lib/Moose/Meta/Attribute.pm index fae6ee6..a4d83ba 100644 --- a/lib/Moose/Meta/Attribute.pm +++ b/lib/Moose/Meta/Attribute.pm @@ -146,6 +146,7 @@ my @legal_options_for_inheritance = qw( documentation lazy handles builder type_constraint definition_context + lazy_build ); sub legal_options_for_inheritance { @legal_options_for_inheritance } diff --git a/t/020_attributes/009_attribute_inherited_slot_specs.t b/t/020_attributes/009_attribute_inherited_slot_specs.t index 1c825d9..3b53a1d 100644 --- a/t/020_attributes/009_attribute_inherited_slot_specs.t +++ b/t/020_attributes/009_attribute_inherited_slot_specs.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 83; +use Test::More tests => 84; use Test::Exception; @@ -72,6 +72,10 @@ use Test::Exception; } '... we can change/add lazy as an attribute option'; ::lives_ok { + has '+gloum' => (lazy_build => 1); + } '... we can add lazy_build as an attribute option'; + + ::lives_ok { has '+bunch_of_stuff' => (isa => 'ArrayRef[Int]'); } '... extend an attribute with parameterized type';