Revert "add an option to disable the mutable ancestor warning"
[gitmo/Moose.git] / t / 300_immutable / 005_multiple_demolish_inline.t
CommitLineData
ee7f68b6 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
9f79e616 6use Test::More tests => 5;
ee7f68b6 7use Test::Exception;
8
7ff56534 9
ee7f68b6 10
11{
12 package Foo;
13 use Moose;
14
15 has 'foo' => (is => 'rw', isa => 'Int');
16
17 sub DEMOLISH { }
18}
19
20{
21 package Bar;
22 use Moose;
23
24 extends qw(Foo);
25 has 'bar' => (is => 'rw', isa => 'Int');
26
27 sub DEMOLISH { }
28}
29
30lives_ok {
21f1fbdc 31 Foo->meta->make_immutable;
32} 'Foo->meta->make_immutable';
33
34is( Foo->meta->get_method('DESTROY')->package_name, 'Foo',
35 'Foo has a DESTROY method in the Foo class (not inherited)' );
36
37lives_ok {
ee7f68b6 38 Bar->new();
39} 'Bar->new()';
40
41lives_ok {
a63e370d 42 Bar->meta->make_immutable;
43} 'Bar->meta->make_immutable';
44
45is( Bar->meta->get_method('DESTROY')->package_name, 'Bar',
46 'Bar has a DESTROY method in the Bar class (not inherited)' );