X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F100_bugs%2F030_coerce_without_coercion.t;h=78806881170eae0c08a2612f96d77adc0dcdd6db;hb=e7724627674e5f80d9318fb39cf8976fbe2f837b;hp=413c96555b56a79c00882956d0b7fc9ae607c805;hpb=4ee48f8eb1fcee3230aa1415b57a2eca6531186a;p=gitmo%2FMoose.git 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';