oops. i forgot to change make_immutable code.
[gitmo/Mouse.git] / t / 900_bug / 001_immutable_types.t
CommitLineData
86b99892 1use strict;
2use warnings;
3use Test::More tests => 2;
4use Mouse::Util::TypeConstraints;
5
6subtype '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
20isa_ok(B->new(a => A->new()), 'B');
21B->meta->make_immutable;
22isa_ok(B->new(a => A->new()), 'B');
23