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/14_private_attribute.t | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 't/14_private_attribute.t') 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/); -- cgit 1.4.1