X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FConstructorTests.pm;h=3174157f295f0afec25a6fac886db0e1eae0852d;hb=f6bb95bdebbbae7cf93ef9c3c5644d810c21292f;hp=b36fd0d66c3a071819766955716d3f3224684af7;hpb=dc3621bc7d4b8f216ea39ed9458714eb1c959b9d;p=gitmo%2FMooseX-UndefTolerant.git diff --git a/t/lib/ConstructorTests.pm b/t/lib/ConstructorTests.pm index b36fd0d..3174157 100644 --- a/t/lib/ConstructorTests.pm +++ b/t/lib/ConstructorTests.pm @@ -79,7 +79,8 @@ sub do_tests is (exception { $obj = Foo->new(attr3 => undef) }, undef, 'assigning undef to attr3 is acceptable'); - ok($obj->has_attr3, 'attr3 retains its undef value when assigned undef in constructor'); + ok($obj->has_attr3, 'attr3 still has a value'); + is($obj->attr3, undef, '...which is undef, when assigned undef in constructor'); }, undef, 'successfully tested spot-application of UT trait in ' @@ -118,9 +119,10 @@ sub do_tests 'assigning undef to attr2 does not produce an error'); ok(!$obj->has_attr2, 'attr2 has no value when assigned undef in constructor'); - is( exception { $obj = Foo->new(attr3 => undef) }, undef, + is( exception { $obj = Bar->new(attr3 => undef) }, undef, 'assigning undef to attr3 is acceptable'); - ok($obj->has_attr3, 'attr3 retains its undef value when assigned undef in constructor'); + ok($obj->has_attr3, 'attr3 still has a value'); + is($obj->attr3, undef, '...which is undef, when assigned undef in constructor'); } {