Fix test description
[gitmo/Class-MOP.git] / t / 310_immutable_destroy.t
CommitLineData
1a3857b9 1use strict;
2use warnings;
3use Test::More tests => 1;
4use Class::MOP;
5
935fdc89 6SKIP: {
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 21EOF
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}