Commit | Line | Data |
---|---|---|
1a3857b9 | 1 | use strict; |
2 | use warnings; | |
3 | use Test::More tests => 1; | |
4 | use Class::MOP; | |
5 | ||
935fdc89 | 6 | SKIP: { |
7 | if (not eval { require Moose; 1 }) { | |
bad78bd3 | 8 | skip 'test requires moose', 1; |
9 | exit 0; | |
10 | } | |
bad78bd3 | 11 | |
935fdc89 | 12 | eval <<FOOBAR; |
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; | |
935fdc89 | 21 | FOOBAR |
1a3857b9 | 22 | |
935fdc89 | 23 | my $f = FooBar->new( name => 'SUSAN' ); |
1a3857b9 | 24 | |
10e77b62 | 25 | is( $f->DESTROY, 'SUSAN', 'Did Class::MOP::Class overload DESTROY?' ); |
935fdc89 | 26 | } |