Fix test description
[gitmo/Class-MOP.git] / t / 310_immutable_destroy.t
1 use strict;
2 use warnings;
3 use Test::More tests => 1;
4 use Class::MOP;
5
6 SKIP: {
7     unless (eval { require Moose; 1 }) {
8         skip 'This test requires Moose', 1;
9         exit 0;
10     }
11
12     eval <<'EOF';
13     package FooBar;
14     use Moose;
15
16     has 'name' => ( is => 'ro' );
17
18     sub DESTROY { shift->name }
19
20     __PACKAGE__->meta->make_immutable;
21 EOF
22
23     my $f = FooBar->new( name => 'SUSAN' );
24
25     is( $f->DESTROY, 'SUSAN',
26         'Class::MOP::Class should not override an existing DESTROY method' );
27 }