Commit | Line | Data |
1ca8d984 |
1 | #!/usr/bin/perl |
16504b15 |
2 | # This is automatically generated by author/import-moose-test.pl. |
3 | # DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!! |
4 | use t::lib::MooseCompat; |
1ca8d984 |
5 | |
6 | use strict; |
7 | use warnings; |
8 | |
16504b15 |
9 | use Test::More; |
1ca8d984 |
10 | use Test::Exception; |
11 | |
12 | |
1ca8d984 |
13 | { |
14 | package Foo; |
15 | use Mouse; |
16 | |
17 | has 'foo' => (is => 'rw', isa => 'Int'); |
18 | |
19 | sub DEMOLISH { } |
20 | } |
21 | |
22 | { |
23 | package Bar; |
24 | use Mouse; |
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 | Bar->meta->make_immutable; |
38 | } 'Bar->meta->make_immutable'; |
39 | |
40 | is( Bar->meta->get_method('DESTROY')->package_name, 'Bar', |
41 | 'Bar has a DESTROY method in the Bar class (not inherited)' ); |
42 | |
43 | lives_ok { |
44 | Foo->meta->make_immutable; |
45 | } 'Foo->meta->make_immutable'; |
46 | |
47 | is( Foo->meta->get_method('DESTROY')->package_name, 'Foo', |
48 | 'Foo has a DESTROY method in the Bar class (not inherited)' ); |
16504b15 |
49 | |
50 | done_testing; |