From: Fuji, Goro Date: Fri, 12 Nov 2010 06:42:27 +0000 (+0900) Subject: Tests X-Git-Tag: 0.86~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7d4507ba0976d10a036aaa3a3a2ecb74c2bc38fb;p=gitmo%2FMouse.git Tests --- diff --git a/t/001_mouse/806-role_type.t b/t/001_mouse/806-role_type.t index 5893ddb..a235dac 100644 --- a/t/001_mouse/806-role_type.t +++ b/t/001_mouse/806-role_type.t @@ -1,6 +1,6 @@ use strict; use warnings; -use Test::More tests => 5; +use Test::More; { package Request::Headers::Role; @@ -40,7 +40,7 @@ use Test::More tests => 5; has headers => ( is => 'rw', - isa => 'Headers', + does => 'Headers', coerce => 1, ); } @@ -55,4 +55,12 @@ is($res->headers->foo, 'yay'); eval { $res->headers( Request::Headers->new( foo => 'baz' ) ); }; -ok $@; +like $@, qr/Validation failed/; + +eval { + $res->headers( Request::Headers->new( foo => undef ) ); +}; +like $@, qr/Validation failed/; + +done_testing; +