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=ccc7e14250a3c65bc4b4c0104729356075b6fe06;hpb=619ab942be0a8bd8f530c57ca5b0c8d833cdc89b;p=gitmo%2FMooseX-Storage.git diff --git a/t/003_basic_w_embedded_objects.t b/t/003_basic_w_embedded_objects.t index ccc7e14..03ef4af 100644 --- a/t/003_basic_w_embedded_objects.t +++ b/t/003_basic_w_embedded_objects.t @@ -1,5 +1,3 @@ -#!/usr/bin/perl - use strict; use warnings; @@ -12,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 @@ -24,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' + ); } { @@ -55,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' ); @@ -77,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' ); @@ -101,7 +99,7 @@ ArrayRef and HashRef type handlers. bars => { map { ($_ => Bar->new(number => $_)) } (1 .. 10) } ); isa_ok( $baz, 'Baz' ); - + cmp_deeply( $baz->pack, { @@ -111,9 +109,9 @@ ArrayRef and HashRef type handlers. ($_ => { __CLASS__ => 'Bar', number => $_, - }) + }) } (1 .. 10) - }, + }, }, '... got the right frozen class' ); @@ -128,10 +126,10 @@ ArrayRef and HashRef type handlers. ($_ => { __CLASS__ => 'Bar', number => $_, - }) + }) } (1 .. 10) - }, - } + }, + } ); isa_ok( $baz, 'Baz' );