From c8d40ecee67b80a8665eb0928882cb7fa2d15fde Mon Sep 17 00:00:00 2001 From: franck cuny Date: Thu, 29 Apr 2010 09:16:10 +0200 Subject: update tests, use with_immutable --- t/11_protected_method.t | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 't/11_protected_method.t') 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/); -- cgit v1.2.3