X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F020_attributes%2F009_attribute_inherited_slot_specs.t;h=593c9d4d49a8b3fb26d5db3abfd649cfd466030c;hb=f785aad8b8e799322985d8acce2bcb88fadc24a0;hp=46963b783f8a5d3f14fa9bb0f095a1c74fee0129;hpb=d03bd989b97597428b460d7f9a021e2931893fa0;p=gitmo%2FMoose.git diff --git a/t/020_attributes/009_attribute_inherited_slot_specs.t b/t/020_attributes/009_attribute_inherited_slot_specs.t index 46963b7..593c9d4 100644 --- a/t/020_attributes/009_attribute_inherited_slot_specs.t +++ b/t/020_attributes/009_attribute_inherited_slot_specs.t @@ -3,11 +3,10 @@ use strict; use warnings; -use Test::More tests => 84; +use Test::More; use Test::Exception; - { package Thing; use Moose; @@ -33,6 +32,7 @@ use Test::Exception; has 'gorch' => (is => 'ro'); has 'gloum' => (is => 'ro', default => sub {[]}); + has 'fleem' => (is => 'ro'); has 'bling' => (is => 'ro', isa => 'Thing'); has 'blang' => (is => 'ro', isa => 'Thing', handles => ['goodbye']); @@ -42,8 +42,8 @@ use Test::Exception; has 'one_last_one' => (is => 'rw', isa => 'Ref'); # this one will work here .... - has 'fail' => (isa => 'CodeRef'); - has 'other_fail'; + has 'fail' => (isa => 'CodeRef', is => 'bare'); + has 'other_fail' => (is => 'bare'); package Bar; use Moose; @@ -88,6 +88,10 @@ use Test::Exception; } '... now can extend an attribute with a non-subtype'; ::lives_ok { + has '+fleem' => (weak_ref => 1); + } '... now allowed to add the weak_ref option via inheritance'; + + ::lives_ok { has '+bling' => (handles => ['hello']); } '... we can add the handles attribute option'; @@ -101,9 +105,6 @@ use Test::Exception; ::dies_ok { has '+other_fail' => (trigger => sub {}); } '... cannot create an attribute with an illegal option'; - ::dies_ok { - has '+other_fail' => (weak_ref => 1); - } '... cannot create an attribute with an illegal option'; ::throws_ok { has '+does_not_exist' => (isa => 'Str'); } qr/in Bar/, '... cannot extend a non-existing attribute'; @@ -259,4 +260,4 @@ ok(!Foo->meta->get_attribute('bling')->has_handles, ok(Bar->meta->get_attribute('bling')->has_handles, '... Bar::foo should handles'); - +done_testing;