t/900_bug/001_immutable_types.t: oops. 'package B' means B.pm, reserved namespace...
[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
89a97ba1 6subtype 'Foo', as 'Object', where { $_->isa('A') };
86b99892 7
8{
9 package A;
10 use Mouse;
11 has data => ( is => 'rw', isa => 'Str' );
12}
13
14{
89a97ba1 15 package C;
86b99892 16 use Mouse;
17 has a => ( is => 'rw', isa => 'Foo', coerce => 1 );
18}
19
89a97ba1 20isa_ok(C->new(a => A->new()), 'C');
21C->meta->make_immutable;
22isa_ok(C->new(a => A->new()), 'C');
86b99892 23