X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F003_basic_w_embedded_objects.t;h=03ef4af32659b919e33988a9696384b0119dab7c;hb=c2d52f94beb56939250944a12df15d7d90779866;hp=65a500151eca9ddbfe0a228a7d31c6af8e87ee2e;hpb=81a84db6ebe5ec540d0035fc6d1104cc49c81e25;p=gitmo%2FMooseX-Storage.git diff --git a/t/003_basic_w_embedded_objects.t b/t/003_basic_w_embedded_objects.t index 65a5001..03ef4af 100644 --- a/t/003_basic_w_embedded_objects.t +++ b/t/003_basic_w_embedded_objects.t @@ -10,8 +10,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 @@ -22,30 +22,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' + ); } { @@ -53,19 +53,19 @@ ArrayRef and HashRef type handlers. bars => [ map { Bar->new(number => $_) } (1 .. 10) ] ); isa_ok( $foo, 'Foo' ); - + cmp_deeply( $foo->pack, { __CLASS__ => 'Foo', - bars => [ + bars => [ map { { __CLASS__ => 'Bar', number => $_, - } + } } (1 .. 10) - ], + ], }, '... got the right frozen class' ); @@ -75,15 +75,15 @@ ArrayRef and HashRef type handlers. my $foo = Foo->unpack( { __CLASS__ => 'Foo', - bars => [ + bars => [ map { { __CLASS__ => 'Bar', number => $_, - } + } } (1 .. 10) - ], - } + ], + } ); isa_ok( $foo, 'Foo' ); @@ -99,7 +99,7 @@ ArrayRef and HashRef type handlers. bars => { map { ($_ => Bar->new(number => $_)) } (1 .. 10) } ); isa_ok( $baz, 'Baz' ); - + cmp_deeply( $baz->pack, { @@ -109,9 +109,9 @@ ArrayRef and HashRef type handlers. ($_ => { __CLASS__ => 'Bar', number => $_, - }) + }) } (1 .. 10) - }, + }, }, '... got the right frozen class' ); @@ -126,10 +126,10 @@ ArrayRef and HashRef type handlers. ($_ => { __CLASS__ => 'Bar', number => $_, - }) + }) } (1 .. 10) - }, - } + }, + } ); isa_ok( $baz, 'Baz' );