From: Dave Rolsky Date: Thu, 10 Sep 2009 17:50:20 +0000 (-0500) Subject: add test that custom immutable options are returned by immutable_options() X-Git-Tag: 0.92_01~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=dd9dc741d5e309f8ca3f3004fbcdd4706449d4a5;p=gitmo%2FClass-MOP.git add test that custom immutable options are returned by immutable_options() --- diff --git a/t/070_immutable_metaclass.t b/t/070_immutable_metaclass.t index 4f6663b..e6f716e 100644 --- a/t/070_immutable_metaclass.t +++ b/t/070_immutable_metaclass.t @@ -1,7 +1,7 @@ use strict; use warnings; -use Test::More tests => 75; +use Test::More tests => 76; use Test::Exception; use Class::MOP; @@ -285,3 +285,30 @@ use Class::MOP; '... got the right list of attributes' ); } + +# This test probably needs to go last since it will muck up the Foo class +{ + my $meta = Foo->meta; + + $meta->make_mutable; + $meta->make_immutable( + inline_accessors => 0, + inline_constructor => 0, + constructor_name => 'newer', + ); + + is_deeply( + { $meta->immutable_options }, + { + inline_accessors => 0, + inline_constructor => 0, + inline_destructor => 0, + debug => 0, + immutable_trait => 'Class::MOP::Class::Immutable::Trait', + constructor_name => 'newer', + constructor_class => 'Class::MOP::Method::Constructor', + destructor_class => undef, + }, + 'custom immutable_options are returned by immutable_options accessor' + ); +}