summary refs log tree commit diff
path: root/t/14_private_attribute.t
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2010-04-29 09:16:10 +0200
committerfranck cuny <franck@lumberjaph.net>2010-04-29 09:16:10 +0200
commitc8d40ecee67b80a8665eb0928882cb7fa2d15fde (patch)
tree993c09eead0c24709c4252fdaaca5b87b36f396c /t/14_private_attribute.t
parentPOD cleaning (diff)
downloadmoosex-privacy-c8d40ecee67b80a8665eb0928882cb7fa2d15fde.tar.gz
update tests, use with_immutable
Diffstat (limited to 't/14_private_attribute.t')
-rw-r--r--t/14_private_attribute.t18
1 files changed, 10 insertions, 8 deletions
diff --git a/t/14_private_attribute.t b/t/14_private_attribute.t
index 70ff5d1..811294a 100644
--- a/t/14_private_attribute.t
+++ b/t/14_private_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;
 
 {
 
@@ -14,12 +15,6 @@ use Test::Exception;
     sub bar { my $self = shift; $self->foo('bar'); $self->foo }
 }
 
-ok my $foo = Foo->new();
-
-dies_ok { $foo->foo };
-ok $foo->bar;
-is scalar @{ $foo->meta->local_private_attributes }, 1;
-
 {
 
     package Bar;
@@ -27,7 +22,14 @@ is scalar @{ $foo->meta->local_private_attributes }, 1;
     has bar => ( is => 'rw', isa => 'Str', traits => [qw/Private/] );
 }
 
-ok my $bar = Bar->new();
+with_immutable {
+    ok my $foo = Foo->new();
 
+    dies_ok { $foo->foo };
+    ok $foo->bar;
+    is scalar @{ $foo->meta->local_private_attributes }, 1;
+    ok my $bar = Bar->new();
+}
+(qw/Foo Bar/);