X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fconstructor.t;fp=t%2Fconstructor.t;h=ca5131566739d00f8a2f990d7edd5fb33ba4e08e;hb=015b91679983f142397cd7172262a5e56f3cd850;hp=a638cbf7832997f50074f2c9770b0408c8f28878;hpb=581c4a1866ff70f8b5a29918bf773a882c6f8e61;p=gitmo%2FMooseX-UndefTolerant.git diff --git a/t/constructor.t b/t/constructor.t index a638cbf..ca51315 100644 --- a/t/constructor.t +++ b/t/constructor.t @@ -50,7 +50,7 @@ sub do_tests { my $obj = Foo->new(attr1 => undef); ok(!$obj->has_attr1, 'UT attr1 has no value when assigned undef in constructor'); - ok (exception { $obj = Foo->new(attr2 => undef) }, + is (exception { $obj = Foo->new(attr2 => undef) }, undef, 'But assigning undef to attr2 generates a type constraint error'); } @@ -73,7 +73,7 @@ sub do_tests { my $obj = Bar->new(attr1 => undef); ok(!$obj->has_attr1, 'attr1 has no value when assigned undef in constructor'); - ok (!exception { $obj = Bar->new(attr2 => undef) }, + is (exception { $obj = Bar->new(attr2 => undef) }, undef, 'assigning undef to attr2 does not produce an error'); ok(!$obj->has_attr2, 'attr2 has no value when assigned undef in constructor'); } @@ -98,7 +98,7 @@ Bar->meta->make_immutable; TODO: { local $TODO = 'some immutable cases are not handled yet'; # for now, catch errors - ok(! exception { do_tests }, 'tests do not die'); + is(exception { do_tests }, undef, 'tests do not die'); is(Test::More->builder->current_test, 28, 'if we got here, we can declare victory!'); }