6 use Test::More tests => 12;
9 use_ok('MooseX::Storage');
20 has 'number' => ( is => 'ro', isa => 'Int' );
21 has 'string' => ( is => 'ro', isa => 'Str' );
22 has 'boolean' => ( is => 'ro', isa => 'Bool' );
23 has 'float' => ( is => 'ro', isa => 'Num' );
24 has 'array' => ( is => 'ro', isa => 'ArrayRef' );
25 has 'hash' => ( is => 'ro', isa => 'HashRef' );
26 has 'object' => ( is => 'ro', isa => 'Foo' );
36 hash => { map { $_ => undef } ( 1 .. 10 ) },
37 object => Foo->new( number => 2 ),
39 isa_ok( $foo, 'Foo' );
50 hash => { map { $_ => undef } ( 1 .. 10 ) },
56 '... got the right frozen class'
61 my $foo = Foo->unpack(
69 hash => { map { $_ => undef } ( 1 .. 10 ) },
76 isa_ok( $foo, 'Foo' );
78 is( $foo->number, 10, '... got the right number' );
79 is( $foo->string, 'foo', '... got the right string' );
80 ok( $foo->boolean, '... got the right boolean' );
81 is( $foo->float, 10.5, '... got the right float' );
82 is_deeply( $foo->array, [ 1 .. 10 ], '... got the right array' );
85 { map { $_ => undef } ( 1 .. 10 ) },
86 '... got the right hash'
89 isa_ok( $foo->object, 'Foo' );
90 is( $foo->object->number, 2,
91 '... got the right number (in the embedded object)' );