From: Dave Rolsky Date: Mon, 19 Jul 2010 17:10:05 +0000 (-0500) Subject: Turn off deprecation warnings. X-Git-Tag: 1.09~13 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5d9b0b8843b8c2ea8cc0b54b5ba62556dee5a762;p=gitmo%2FMoose.git Turn off deprecation warnings. Make sure that setting an invalid value fails --- diff --git a/t/100_bugs/030_coerce_without_coercion.t b/t/100_bugs/030_coerce_without_coercion.t index 413c965..7880688 100644 --- a/t/100_bugs/030_coerce_without_coercion.t +++ b/t/100_bugs/030_coerce_without_coercion.t @@ -8,7 +8,7 @@ use Test::Moose; { package Foo; - use Moose::Deprecated -api_version => '1.08'; + use Moose::Deprecated -api_version => '1.07'; use Moose; has x => ( @@ -25,7 +25,13 @@ with_immutable { lives_ok { Foo->new->x( {} ) } 'Setting coerce => 1 without a coercion on the type does not cause an error when setting the attribut'; - lives_ok { Foo->new( x => 42 ) } 'asasf'; + throws_ok { Foo->new( x => 42 ) } + qr/\QAttribute (x) does not pass the type constraint because/, + 'Attempting to provide an invalid value to the constructor for this attr still fails'; + + throws_ok { Foo->new->x(42) } + qr/\QAttribute (x) does not pass the type constraint because/, + 'Attempting to provide an invalid value to the accessor for this attr still fails'; } 'Foo';