X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F300_immutable%2F015_immutable_destroy.t;fp=t%2F300_immutable%2F015_immutable_destroy.t;h=32b6fe4cc862bf1c7c1d8170b6d79e32d0c32a19;hb=47e5ab1a005a6233ffe96221ba1aa0baee4832b2;hp=0000000000000000000000000000000000000000;hpb=fcae36ea498b45de3a79b993b363f89989d3f664;p=gitmo%2FMoose.git diff --git a/t/300_immutable/015_immutable_destroy.t b/t/300_immutable/015_immutable_destroy.t new file mode 100644 index 0000000..32b6fe4 --- /dev/null +++ b/t/300_immutable/015_immutable_destroy.t @@ -0,0 +1,19 @@ +#!/usr/bin/perl +use strict; +use warnings; +use Test::More tests => 1; + +BEGIN { + package FooBar; + use Moose; + + has 'name' => (is => 'ro'); + + sub DESTROY { shift->name } + + __PACKAGE__->meta->make_immutable; +} + +my $f = FooBar->new(name => "SUSAN"); + +is($f->DESTROY, "SUSAN", "Did moose overload DESTROY?");