9 plan skip_all => "Moose 0.68 required for this test" unless eval { require Moose && Moose->VERSION('0.68') };
18 has 'foo' => ( is => 'rw' );
23 use Mouse::Util::TypeConstraints;
25 type '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 local $TODO = "Doesn't work in the constructor yet?";
47 my $r = Mosponse->new(headers => { foo => 'bar' });
48 isa_ok($r->headers, 'Headers');
49 is(eval{$r->headers->foo}, 'bar');
53 my $r = Mosponse->new;
54 $r->headers({foo => 'yay'});
55 isa_ok($r->headers, 'Headers');
56 is($r->headers->foo, 'yay');