diff options
Diffstat (limited to 't/immutable/immutable_destroy.t')
-rw-r--r-- | t/immutable/immutable_destroy.t | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/t/immutable/immutable_destroy.t b/t/immutable/immutable_destroy.t new file mode 100644 index 0000000..8dfc3d3 --- /dev/null +++ b/t/immutable/immutable_destroy.t @@ -0,0 +1,21 @@ +use strict; +use warnings; +use Test::More; + +{ + package FooBar; + use Moose; + + has 'name' => ( is => 'ro' ); + + sub DESTROY { shift->name } + + local $SIG{__WARN__} = sub {}; + __PACKAGE__->meta->make_immutable; +} + +my $f = FooBar->new( name => 'SUSAN' ); + +is( $f->DESTROY, 'SUSAN', 'Did moose overload DESTROY?' ); + +done_testing; |