test under various mutablation scenarios
[gitmo/Moose.git] / t / 300_immutable / 005_multiple_demolish_inline.t
CommitLineData
ee7f68b6 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6use Test::More tests => 3;
7use Test::Exception;
8
9BEGIN {
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
32lives_ok {
33 Bar->new();
34} 'Bar->new()';
35
36lives_ok {
37 my $bar = Bar->new();
38 $bar->meta->make_immutable;
39} 'Bar->meta->make_immutable';