Add what does moose stand for section back to docs
[gitmo/Moose.git] / t / immutable / multiple_demolish_inline.t
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 use Test::More;
7 use Test::Fatal;
8
9
10 {
11     package Foo;
12     use Moose;
13
14     has 'foo' => (is => 'rw', isa => 'Int');
15
16     sub DEMOLISH { }
17 }
18
19 {
20     package Bar;
21     use Moose;
22
23     extends qw(Foo);
24     has 'bar' => (is => 'rw', isa => 'Int');
25
26     sub DEMOLISH { }
27 }
28
29 is( exception {
30     Bar->new();
31 }, undef, 'Bar->new()' );
32
33 is( exception {
34     Bar->meta->make_immutable;
35 }, undef, 'Bar->meta->make_immutable' );
36
37 is( Bar->meta->get_method('DESTROY')->package_name, 'Bar',
38     'Bar has a DESTROY method in the Bar class (not inherited)' );
39
40 is( exception {
41     Foo->meta->make_immutable;
42 }, undef, 'Foo->meta->make_immutable' );
43
44 is( Foo->meta->get_method('DESTROY')->package_name, 'Foo',
45     'Foo has a DESTROY method in the Bar class (not inherited)' );
46
47 done_testing;