summaryrefslogtreecommitdiff
path: root/t/15_protected_attribute.t
diff options
context:
space:
mode:
Diffstat (limited to 't/15_protected_attribute.t')
-rw-r--r--t/15_protected_attribute.t19
1 files changed, 11 insertions, 8 deletions
diff --git a/t/15_protected_attribute.t b/t/15_protected_attribute.t
index 3c2ae8d..fe3fd9a 100644
--- a/t/15_protected_attribute.t
+++ b/t/15_protected_attribute.t
@@ -1,8 +1,9 @@
use strict;
use warnings;
-use Test::More tests => 5;
+use Test::More tests => 10;
use Test::Exception;
+use Test::Moose;
{
@@ -24,16 +25,18 @@ use Test::Exception;
use Moose;
extends 'Foo';
- sub bar { (shift)->foo };
+ sub bar { (shift)->foo }
}
-ok my $foo = Foo->new();
-dies_ok { $foo->foo };
-is scalar @{ $foo->meta->local_protected_attributes }, 1;
-
-ok my $bar = Bar->new();
-ok $bar->bar();
+with_immutable {
+ ok my $foo = Foo->new();
+ dies_ok { $foo->foo };
+ is scalar @{ $foo->meta->local_protected_attributes }, 1;
+ ok my $bar = Bar->new();
+ ok $bar->bar();
+}
+(qw/Foo Bar/);