added test for DESTROY/immutable regression in moose 0.80/0.81.
Dylan William Hardison [Thu, 11 Jun 2009 02:50:17 +0000 (02:50 +0000)]
t/300_immutable/015_immutable_destroy.t [new file with mode: 0644]

diff --git a/t/300_immutable/015_immutable_destroy.t b/t/300_immutable/015_immutable_destroy.t
new file mode 100644 (file)
index 0000000..32b6fe4
--- /dev/null
@@ -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?");