X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMooseX-Storage.git;a=blobdiff_plain;f=t%2F003_basic_w_embedded_objects.t;fp=t%2F003_basic_w_embedded_objects.t;h=19d3edbed5c2e2e65c333e11a3f00419dc3f1352;hp=55c4e6cb3735339bb50c35dd036aa1d00b8c3d93;hb=766ab81f59db9f3087e0011112ff2e69133a85c5;hpb=11d44bb52ca8164d34774985af7b550cfd0c60a0 diff --git a/t/003_basic_w_embedded_objects.t b/t/003_basic_w_embedded_objects.t index 55c4e6c..19d3edb 100644 --- a/t/003_basic_w_embedded_objects.t +++ b/t/003_basic_w_embedded_objects.t @@ -11,8 +11,8 @@ BEGIN { =pod -This test checks the single level -expansion and collpasing of the +This test checks the single level +expansion and collpasing of the ArrayRef and HashRef type handlers. =cut @@ -23,30 +23,30 @@ ArrayRef and HashRef type handlers. use MooseX::Storage; with Storage; - + has 'number' => (is => 'ro', isa => 'Int'); - + package Foo; use Moose; use MooseX::Storage; - with Storage; + with Storage; - has 'bars' => ( - is => 'ro', - isa => 'ArrayRef' + has 'bars' => ( + is => 'ro', + isa => 'ArrayRef' ); - + package Baz; use Moose; use MooseX::Storage; - with Storage; + with Storage; - has 'bars' => ( - is => 'ro', - isa => 'HashRef' - ); + has 'bars' => ( + is => 'ro', + isa => 'HashRef' + ); } { @@ -54,19 +54,19 @@ ArrayRef and HashRef type handlers. bars => [ map { Bar->new(number => $_) } (1 .. 10) ] ); isa_ok( $foo, 'Foo' ); - + is_deeply( $foo->pack, { __CLASS__ => 'Foo', - bars => [ + bars => [ map { { __CLASS__ => 'Bar', number => $_, - } + } } (1 .. 10) - ], + ], }, '... got the right frozen class' ); @@ -76,15 +76,15 @@ ArrayRef and HashRef type handlers. my $foo = Foo->unpack( { __CLASS__ => 'Foo', - bars => [ + bars => [ map { { __CLASS__ => 'Bar', number => $_, - } + } } (1 .. 10) - ], - } + ], + } ); isa_ok( $foo, 'Foo' ); @@ -100,7 +100,7 @@ ArrayRef and HashRef type handlers. bars => { map { ($_ => Bar->new(number => $_)) } (1 .. 10) } ); isa_ok( $baz, 'Baz' ); - + is_deeply( $baz->pack, { @@ -110,9 +110,9 @@ ArrayRef and HashRef type handlers. ($_ => { __CLASS__ => 'Bar', number => $_, - }) + }) } (1 .. 10) - }, + }, }, '... got the right frozen class' ); @@ -127,10 +127,10 @@ ArrayRef and HashRef type handlers. ($_ => { __CLASS__ => 'Bar', number => $_, - }) + }) } (1 .. 10) - }, - } + }, + } ); isa_ok( $baz, 'Baz' );