add tests 't/*.t t/*/*.t';
[gitmo/Mouse.git] / t / 803-make_immutable.t
1 use strict;
2 use warnings;
3 use Test::More tests => 4;
4 use t::Exception;
5
6 {
7     package HardDog;
8     use Mouse;
9     has bone => (
10         is => 'rw',
11         required => 1,
12     );
13     no Mouse;
14     __PACKAGE__->meta->make_immutable;
15 }
16
17 {
18     package SoftDog;
19     use Mouse;
20     has bone => (
21         is => 'rw',
22         required => 1,
23     );
24     no Mouse;
25 }
26
27 lives_ok { SoftDog->new(bone => 'moo') };
28 lives_ok { HardDog->new(bone => 'moo') };
29
30 throws_ok { SoftDog->new() } qr/\QAttribute (bone) is required/;
31 throws_ok { HardDog->new() } qr/\QAttribute (bone) is required/;
32