use strict;
use warnings;
-use Test::More tests => 5;
+use Test::More;
{
package Request::Headers::Role;
has headers => (
is => 'rw',
- isa => 'Headers',
+ does => 'Headers',
coerce => 1,
);
}
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;
+