Commit | Line | Data |
---|---|---|
1a3857b9 | 1 | use strict; |
2 | use warnings; | |
3 | use Test::More tests => 1; | |
4 | use Class::MOP; | |
5 | ||
935fdc89 | 6 | SKIP: { |
1fd159f5 | 7 | unless (eval { require Moose; 1 }) { |
d26a2799 | 8 | skip 'This test requires Moose', 1; |
25850941 | 9 | exit 0; |
10 | } | |
bad78bd3 | 11 | |
1fd159f5 | 12 | eval <<'EOF'; |
bad78bd3 | 13 | package FooBar; |
14 | use Moose; | |
15 | ||
16 | has 'name' => ( is => 'ro' ); | |
17 | ||
18 | sub DESTROY { shift->name } | |
19 | ||
20 | __PACKAGE__->meta->make_immutable; | |
1fd159f5 | 21 | EOF |
1a3857b9 | 22 | |
25850941 | 23 | my $f = FooBar->new( name => 'SUSAN' ); |
1a3857b9 | 24 | |
a01bdd23 | 25 | is( $f->DESTROY, 'SUSAN', |
26 | 'Class::MOP::Class should not override an existing DESTROY method' ); | |
935fdc89 | 27 | } |