3 use Test::More tests => 4;
7 use Mouse::Util::TypeConstraints;
9 require t::lib::ClassType_Foo;
11 # XXX: This below API is different from that of Moose.
12 # class_type() should be class_type 'ClassName';
13 # class_type 'Headers' => { class => 't::lib::ClassType_Foo' };
14 # this should be subtype Headers => as 't::lib::ClassType_foo';
16 => as 't::lib::ClassType_Foo'
20 from 'HashRef' => via {
21 t::lib::ClassType_Foo->new(%{ $_ });
32 my $res = Response->new(headers => { foo => 'bar' });
33 isa_ok($res->headers, 't::lib::ClassType_Foo');
34 is($res->headers->foo, 'bar');
35 $res->headers({foo => 'yay'});
36 isa_ok($res->headers, 't::lib::ClassType_Foo');
37 is($res->headers->foo, 'yay');