6 use Test::More tests => 11;
10 use_ok('MooseX::Storage');
21 metaclass => 'DoNotSerialize',
23 default => sub { 'BAR' }
27 traits => [ 'DoNotSerialize' ],
29 default => sub { 'BAZ' }
34 default => sub { 'GORCH' }
43 is($foo->bar, 'BAR', '... got the value we expected');
44 is($foo->baz, 'BAZ', '... got the value we expected');
45 is($foo->gorch, 'GORCH', '... got the value we expected');
53 '... got the right packed class data'
57 ### more involved test; required attribute that's not serialized
65 metaclass => 'DoNotSerialize',
71 default => sub { $$ },
76 { my $bar = Bar->new( foo => $$ );
78 ok( $bar, "New object created" );
79 is( $bar->foo, $$, " ->foo => $$" );
80 is( $bar->zot, $$, " ->zot => $$" );
82 my $bpack = $bar->pack;
87 }, " Packed correctly" );
89 my $bar2 = Bar->unpack({ %$bpack, foo => $$ });
90 ok( $bar2, " Unpacked correctly by supplying foo => $$");