10 'MooseX::Storage::Format::JSONpm' => 0.01, # skip all if not installed
15 use_ok('MooseX::Storage');
23 with Storage(format => [ JSONpm => { json_opts => { pretty => 1 } } ] );
25 has 'string' => ( is => 'ro', isa => 'Str' );
26 has 'float' => ( is => 'ro', isa => 'Num' );
34 isa_ok( $foo, 'Foo' );
36 my $json = $foo->freeze;
41 "there are newlines in our JSON, because it is pretty",
51 our $VERSION = '0.01';
53 with 'MooseX::Storage::Deferred';
55 has 'x' => (is => 'rw', isa => 'Int');
56 has 'y' => (is => 'rw', isa => 'Int');
60 [ string => 'JSONpm' ],
61 [ aref0p => [ JSONpm => ] ],
62 [ aref1p => [ JSONpm => { json_opts => { pretty => 1 } } ] ],
64 my ($name, $p) = @$jsonpm;
66 my $json = eval { Bar->new(x => 10, y => 20)->freeze({ format => $p }) };
69 JSON->new->decode($json),
71 '__CLASS__' => 'Bar-0.01',
75 "correct deferred freeze from $name",