X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F501_moose_coerce_mouse.t;h=21654820b625a651cc9d0096d0b74999688d96cc;hb=49540190fbfbd3e3227106a57bcf9a7ef7d554e8;hp=2865e7da90447c81f18e03328f3b6697917d3759;hpb=61a02a3addc8542afac0bbd222610d7e050137ce;p=gitmo%2FMouse.git diff --git a/t/501_moose_coerce_mouse.t b/t/501_moose_coerce_mouse.t index 2865e7d..2165482 100644 --- a/t/501_moose_coerce_mouse.t +++ b/t/501_moose_coerce_mouse.t @@ -6,7 +6,7 @@ use warnings; use Test::More; use Test::Exception; BEGIN { - plan skip_all => "Moose required for this test" unless eval { require Moose && Moose->VERSION('0.59') }; + plan skip_all => "Moose 0.68 required for this test" unless eval { require Moose && Moose->VERSION('0.68') }; plan tests => 5; } @@ -20,9 +20,9 @@ use Test::Exception; { package Response; use Mouse; - use Mouse::TypeRegistry; + use Mouse::Util::TypeConstraints; - subtype 'HeadersType' => where { defined $_ && eval { $_->isa('Headers') } }; + type 'HeadersType' => where { defined $_ && eval { $_->isa('Headers') } }; coerce 'HeadersType' => from 'HashRef' => via { Headers->new(%{ $_ }); @@ -43,10 +43,14 @@ use Test::Exception; } { + local $TODO = "Doesn't work in the constructor yet?"; my $r = Mosponse->new(headers => { foo => 'bar' }); - local our $TODO = "Moose not yet aware of Mouse meta"; isa_ok($r->headers, 'Headers'); is(eval{$r->headers->foo}, 'bar'); +} + +{ + my $r = Mosponse->new; $r->headers({foo => 'yay'}); isa_ok($r->headers, 'Headers'); is($r->headers->foo, 'yay');