From: Shawn M Moore Date: Wed, 4 Jun 2008 04:05:08 +0000 (+0000) Subject: Tests for bool, lock down the error message in the test X-Git-Tag: 0.04~93 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e118b33570275a81df743590c49dbf26e8652941;p=gitmo%2FMouse.git Tests for bool, lock down the error message in the test --- diff --git a/t/024-isa.t b/t/024-isa.t index 8e68800..d594814 100644 --- a/t/024-isa.t +++ b/t/024-isa.t @@ -28,8 +28,8 @@ my %values_for_type = ( }, Bool => { - valid => [], - invalid => [], + valid => [undef, "", 1, 0, "1", "0"], + invalid => [1.5, "true", "false", "t", "f", ], }, Undef => { @@ -155,13 +155,13 @@ for my $type (keys %values_for_type) { my $via_new; throws_ok { $via_new = Class->new($type => $value); - } qr/(?!)/; + } qr/Attribute \($type\) does not pass the type constraint because: Validation failed for '$type' failed with value \Q$value\E/; is($via_new, undef, "no object created"); my $via_set = Class->new; throws_ok { $via_set->$type($value); - } qr/(?!)/; + } qr/Attribute \($type\) does not pass the type constraint because: Validation failed for '$type' failed with value \Q$value\E/; is($via_set->$type, undef, "value for $type not set"); }