8 'MooseX::Storage::Format::JSONpm' => 0.01, # skip all if not installed
13 use_ok('MooseX::Storage');
21 with Storage(format => [ JSONpm => { json_opts => { pretty => 1 } } ] );
23 has 'string' => ( is => 'ro', isa => 'Str' );
24 has 'float' => ( is => 'ro', isa => 'Num' );
32 isa_ok( $foo, 'Foo' );
34 my $json = $foo->freeze;
39 "there are newlines in our JSON, because it is pretty",
49 our $VERSION = '0.01';
51 with 'MooseX::Storage::Deferred';
53 has 'x' => (is => 'rw', isa => 'Int');
54 has 'y' => (is => 'rw', isa => 'Int');
58 [ string => 'JSONpm' ],
59 [ aref0p => [ JSONpm => ] ],
60 [ aref1p => [ JSONpm => { json_opts => { pretty => 1 } } ] ],
62 my ($name, $p) = @$jsonpm;
64 my $json = eval { Bar->new(x => 10, y => 20)->freeze({ format => $p }) };
67 JSON->new->decode($json),
69 '__CLASS__' => 'Bar-0.01',
73 "correct deferred freeze from $name",