9 plan skip_all => "Moose required for this test" unless eval { require Moose && Moose->VERSION('0.59') };
18 has 'foo' => ( is => 'rw' );
23 use Mouse::TypeRegistry;
25 subtype 'HeadersType' => where { defined $_ && eval { $_->isa('Headers') } };
26 coerce 'HeadersType' =>
27 from 'HashRef' => via {
28 Headers->new(%{ $_ });
42 ::lives_ok { extends qw(Response) } "extend Mouse class with Moose";
46 my $r = Mosponse->new(headers => { foo => 'bar' });
47 local our $TODO = "Moose not yet aware of Mouse meta";
48 isa_ok($r->headers, 'Headers');
49 is(eval{$r->headers->foo}, 'bar');
50 $r->headers({foo => 'yay'});
51 isa_ok($r->headers, 'Headers');
52 is($r->headers->foo, 'yay');