Commit | Line | Data |
ee7f68b6 |
1 | #!/usr/bin/perl |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
6 | use Test::More tests => 3; |
7 | use Test::Exception; |
8 | |
9 | BEGIN { |
10 | use_ok('Moose'); |
11 | } |
12 | |
13 | { |
14 | package Foo; |
15 | use Moose; |
16 | |
17 | has 'foo' => (is => 'rw', isa => 'Int'); |
18 | |
19 | sub DEMOLISH { } |
20 | } |
21 | |
22 | { |
23 | package Bar; |
24 | use Moose; |
25 | |
26 | extends qw(Foo); |
27 | has 'bar' => (is => 'rw', isa => 'Int'); |
28 | |
29 | sub DEMOLISH { } |
30 | } |
31 | |
32 | lives_ok { |
33 | Bar->new(); |
34 | } 'Bar->new()'; |
35 | |
36 | lives_ok { |
37 | my $bar = Bar->new(); |
38 | $bar->meta->make_immutable; |
39 | } 'Bar->meta->make_immutable'; |