Commit | Line | Data |
---|---|---|
47e5ab1a | 1 | use strict; |
2 | use warnings; | |
3 | use Test::More tests => 1; | |
4 | ||
6735458d | 5 | { |
47e5ab1a | 6 | package FooBar; |
7 | use Moose; | |
8 | ||
6735458d | 9 | has 'name' => ( is => 'ro' ); |
47e5ab1a | 10 | |
11 | sub DESTROY { shift->name } | |
12 | ||
13 | __PACKAGE__->meta->make_immutable; | |
14 | } | |
15 | ||
6735458d | 16 | my $f = FooBar->new( name => "SUSAN" ); |
47e5ab1a | 17 | |
6735458d | 18 | is( $f->DESTROY, "SUSAN", "Did moose overload DESTROY?" ); |