summary refs log tree commit diff
path: root/t/11_protected_method.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/11_protected_method.t
parentPOD cleaning (diff)
downloadmoosex-privacy-c8d40ecee67b80a8665eb0928882cb7fa2d15fde.tar.gz
update tests, use with_immutable
Diffstat (limited to 't/11_protected_method.t')
-rw-r--r--t/11_protected_method.t24
1 files changed, 13 insertions, 11 deletions
diff --git a/t/11_protected_method.t b/t/11_protected_method.t
index 3618069..a7ef35f 100644
--- a/t/11_protected_method.t
+++ b/t/11_protected_method.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;
 
 {
 
@@ -28,16 +29,17 @@ use Test::Exception;
     }
 }
 
-my $foo = Foo->new();
-isa_ok( $foo, 'Foo' );
-dies_ok { $foo->bar } "... can't call bar, method is protected";
-
-my $bar = Bar->new();
-isa_ok( $bar, 'Bar' );
-is $bar->baz(), 'baz', "... got the good value from &bar";
-
-is scalar @{ $foo->meta->local_protected_methods }, 1,
-    '... got one protected method';
+with_immutable {
+    my $foo = Foo->new();
+    isa_ok( $foo, 'Foo' );
+    dies_ok { $foo->bar } "... can't call bar, method is protected";
 
+    my $bar = Bar->new();
+    isa_ok( $bar, 'Bar' );
+    is $bar->baz(), 'baz', "... got the good value from &bar";
 
+    is scalar @{ $foo->meta->local_protected_methods }, 1,
+        '... got one protected method';
+}
+(qw/Foo Bar/);