9 'MooseX::Storage::Format::JSONpm' => 0.01, # skip all if not installed
14 use_ok('MooseX::Storage');
22 with Storage(format => [ JSONpm => { json_opts => { pretty => 1 } } ] );
24 has 'string' => ( is => 'ro', isa => 'Str' );
25 has 'float' => ( is => 'ro', isa => 'Num' );
33 isa_ok( $foo, 'Foo' );
35 my $json = $foo->freeze;
40 "there are newlines in our JSON, because it is pretty",
50 our $VERSION = '0.01';
52 with 'MooseX::Storage::Deferred';
54 has 'x' => (is => 'rw', isa => 'Int');
55 has 'y' => (is => 'rw', isa => 'Int');
59 [ string => 'JSONpm' ],
60 [ aref0p => [ JSONpm => ] ],
61 [ aref1p => [ JSONpm => { json_opts => { pretty => 1 } } ] ],
63 my ($name, $p) = @$jsonpm;
65 my $json = eval { Bar->new(x => 10, y => 20)->freeze({ format => $p }) };
68 JSON->new->decode($json),
70 '__CLASS__' => 'Bar-0.01',
74 "correct deferred freeze from $name",