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=cfd0dd63397d5d5b443aaea4164755c98dabf942;hb=fde8e43f95fe996fbc2a778aa259feeb04552171;hp=0000000000000000000000000000000000000000;hpb=0bdc9d38dfd3de07aad929f6629f8fa65d434c27;p=gitmo%2FMouse.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..cfd0dd6 --- /dev/null +++ b/t/300_immutable/015_immutable_destroy.t @@ -0,0 +1,25 @@ +use strict; +# This is automatically generated by author/import-moose-test.pl. +# DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!! +use t::lib::MooseCompat; +use warnings; +use Test::More; +$TODO = q{Mouse is not yet completed}; + +{ + package FooBar; + use Mouse; + + 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;