From: Dave Rolsky Date: Thu, 16 Jun 2011 15:35:14 +0000 (-0500) Subject: Add some tests for array traits to make sure it doesn't have the same accessor method... X-Git-Tag: 2.0102~12 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=229a897aa9932b2b856249632c63145edcc9502d;hp=d699590f65de3acae397f51e64c5322968b4ce44;p=gitmo%2FMoose.git Add some tests for array traits to make sure it doesn't have the same accessor method bug that hash traits had --- diff --git a/t/native_traits/trait_array.t b/t/native_traits/trait_array.t index f44d0b1..086b143 100644 --- a/t/native_traits/trait_array.t +++ b/t/native_traits/trait_array.t @@ -697,4 +697,22 @@ sub run_tests { $class; } +{ + my ( $class, $handles ) = build_class( isa => 'ArrayRef' ); + my $obj = $class->new; + with_immutable { + is( + exception { $obj->accessor( 0, undef ) }, + undef, + 'can use accessor to set value to undef' + ); + is( + exception { $obj->accessor_curried_1(undef) }, + undef, + 'can use curried accessor to set value to undef' + ); + } + $class; +} + done_testing;