From: hdp Date: Sat, 4 Apr 2009 16:33:17 +0000 (+0000) Subject: test immutable too X-Git-Tag: 0.101~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=03663c54d45739d514e0c0e44232e3959e3964af;p=gitmo%2FMooseX-InsideOut.git test immutable too --- diff --git a/lib/MooseX/InsideOut/Role/Meta/Instance.pm b/lib/MooseX/InsideOut/Role/Meta/Instance.pm index 77f116b..395062a 100644 --- a/lib/MooseX/InsideOut/Role/Meta/Instance.pm +++ b/lib/MooseX/InsideOut/Role/Meta/Instance.pm @@ -52,7 +52,7 @@ around inline_create_instance => sub { my $next = shift; my ($self, $class_variable) = @_; my $code = $self->$next($class_variable); - $code = "do { {my \$instance = ($code);"; + $code = "do { my \$instance = ($code);"; $code .= sprintf( '$%s::attr{Scalar::Util::refaddr($instance)} = {};', __PACKAGE__, diff --git a/t/sub.t b/t/sub.t index 5b704ad..85f6a6b 100644 --- a/t/sub.t +++ b/t/sub.t @@ -1,6 +1,6 @@ use strict; use warnings; -use Test::More tests => 28; +use Test::More tests => 56; use lib 't/lib'; my @classes = qw(IO Array Hash Moose); @@ -40,4 +40,5 @@ for my $c (@classes) { # use Data::Dumper; # diag Dumper($obj); + $sub->meta->make_immutable, redo if $sub->meta->is_mutable; }