diff options
author | franck cuny <franck@lumberjaph.net> | 2010-04-29 09:16:10 +0200 |
---|---|---|
committer | franck cuny <franck@lumberjaph.net> | 2010-04-29 09:16:10 +0200 |
commit | c8d40ecee67b80a8665eb0928882cb7fa2d15fde (patch) | |
tree | 993c09eead0c24709c4252fdaaca5b87b36f396c /t/11_protected_method.t | |
parent | POD cleaning (diff) | |
download | moosex-privacy-c8d40ecee67b80a8665eb0928882cb7fa2d15fde.tar.gz |
update tests, use with_immutable
Diffstat (limited to 't/11_protected_method.t')
-rw-r--r-- | t/11_protected_method.t | 24 |
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/); |