32b6fe4cc862bf1c7c1d8170b6d79e32d0c32a19
[gitmo/Moose.git] / t / 300_immutable / 015_immutable_destroy.t
1 #!/usr/bin/perl
2 use strict;
3 use warnings;
4 use Test::More tests => 1;
5
6 BEGIN {
7     package FooBar;
8     use Moose;
9
10     has 'name' => (is => 'ro');
11
12     sub DESTROY { shift->name }
13
14     __PACKAGE__->meta->make_immutable;
15 }
16
17 my $f = FooBar->new(name => "SUSAN");
18
19 is($f->DESTROY, "SUSAN", "Did moose overload DESTROY?");