2 use Test::More tests => 4;
5 use Mouse::Util::TypeConstraints;
11 return bless { @_ }, $class;
17 where { $_->isa('Class') };
19 subtype 'C', as 'Class'; # subtyping without "where"
23 via { Class->new(content => $_) },
25 via { Class->new(content => $_->{content}) };
40 my $a = A->new(foo => 'foobar');
41 isa_ok $a->foo, 'Class';
42 is $a->foo->{content}, 'foobar';
46 my $a = A->new(foo => { content => 42 });
47 isa_ok $a->foo, 'Class';
48 is $a->foo->{content}, 42;