X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fdefaults.t;h=d48299cf0ba07f78f9bd0db5f60994218cbcaf8e;hb=0833a4a7f2ffbf6290fd90fdfb14c38da47211a5;hp=cca5ed8bc267b6022660c26b0e17944ead551175;hpb=29506dffe03439e9d9e5c2af201aab10ad2ce248;p=gitmo%2FMooseX-UndefTolerant.git diff --git a/t/defaults.t b/t/defaults.t index cca5ed8..d48299c 100644 --- a/t/defaults.t +++ b/t/defaults.t @@ -86,22 +86,23 @@ sub do_tests_with_class } TODO: { - local $TODO; - my $e = exception { my $obj = $class->new(attr1 => undef, attr3 => undef); { local $TODO = 'not sure why this fails still... needs attr trait rewrite' if $obj->meta->is_immutable; + # FIXME: the object is successfully constructed, and the value + # for attr1 is properly removed, but the default is not then + # used instead... + # note "### constructed object: ", $obj->dump(2); ok($obj->has_attr1, 'UT attr1 has a value when assigned undef in constructor'); - ok($obj->has_attr3, 'attr3 retains its undef value when assigned undef in constructor'); - is($obj->attr1, 1, 'attr1\'s value is its default'); } + ok($obj->has_attr3, 'attr3 retains its undef value when assigned undef in constructor'); is($obj->attr2, 2, 'attr2\'s value is its default'); is($obj->attr3, undef, 'attr3\'s value is not its default (explicitly set)'); }; - $TODO = 'some immutable cases are not handled yet; see CAVEATS' + local $TODO = 'some immutable cases are not handled yet; see CAVEATS' if $class->meta->is_immutable and $class eq 'Foo'; is($e, undef, 'these tests do not die');