From: Dylan William Hardison Date: Thu, 11 Jun 2009 02:50:17 +0000 (+0000) Subject: added test for DESTROY/immutable regression in moose 0.80/0.81. X-Git-Tag: 0.82~18^2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=47e5ab1a005a6233ffe96221ba1aa0baee4832b2;p=gitmo%2FMoose.git added test for DESTROY/immutable regression in moose 0.80/0.81. --- 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?");