Test message was wrong. Fixed.
[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: {
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 21FOOBAR
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}