6 use Test::More tests => 11;
9 use_ok('MooseX::Storage');
20 has 'number' => ( is => 'ro', isa => 'Int' );
21 has 'string' => ( is => 'ro', isa => 'Str' );
22 has 'float' => ( is => 'ro', isa => 'Num' );
23 has 'array' => ( is => 'ro', isa => 'ArrayRef' );
24 has 'hash' => ( is => 'ro', isa => 'HashRef' );
25 has 'object' => ( is => 'ro', isa => 'Foo' );
34 hash => { map { $_ => undef } ( 1 .. 10 ) },
35 object => Foo->new( number => 2 ),
37 isa_ok( $foo, 'Foo' );
47 hash => { map { $_ => undef } ( 1 .. 10 ) },
53 '... got the right frozen class'
58 my $foo = Foo->unpack(
65 hash => { map { $_ => undef } ( 1 .. 10 ) },
72 isa_ok( $foo, 'Foo' );
74 is( $foo->number, 10, '... got the right number' );
75 is( $foo->string, 'foo', '... got the right string' );
76 is( $foo->float, 10.5, '... got the right float' );
77 is_deeply( $foo->array, [ 1 .. 10 ], '... got the right array' );
80 { map { $_ => undef } ( 1 .. 10 ) },
81 '... got the right hash'
84 isa_ok( $foo->object, 'Foo' );
85 is( $foo->object->number, 2,
86 '... got the right number (in the embedded object)' );