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/15_protected_attribute.t | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 't/15_protected_attribute.t') 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/); -- cgit v1.2.3