Commit | Line | Data |
---|---|---|
86b99892 | 1 | use strict; |
2 | use warnings; | |
3 | use Test::More tests => 2; | |
4 | use Mouse::Util::TypeConstraints; | |
5 | ||
6 | subtype 'Foo', where => sub { $_->isa('A') }; | |
7 | ||
8 | { | |
9 | package A; | |
10 | use Mouse; | |
11 | has data => ( is => 'rw', isa => 'Str' ); | |
12 | } | |
13 | ||
14 | { | |
15 | package B; | |
16 | use Mouse; | |
17 | has a => ( is => 'rw', isa => 'Foo', coerce => 1 ); | |
18 | } | |
19 | ||
20 | isa_ok(B->new(a => A->new()), 'B'); | |
21 | B->meta->make_immutable; | |
22 | isa_ok(B->new(a => A->new()), 'B'); | |
23 |