5 use File::Temp qw(tempdir);
6 use File::Spec::Functions;
10 'JSON::Any' => 0.01, # skip all if not installed
11 'IO::AtomicFile' => 0.01,
16 # this is because JSON::XS is
17 # the only one which really gets
21 $ENV{JSON_ANY_ORDER} = qw(XS);
22 $ENV{JSON_ANY_CONFIG} = "utf8=0,canonical=1";
25 use_ok('MooseX::Storage');
35 with Storage( 'format' => 'JSON', 'io' => 'AtomicFile' );
37 has 'utf8_string' => (
40 default => sub { "ネットスーパー (Internet Shopping)" }
44 my $file = catfile($dir, 'temp.json');
48 isa_ok( $foo, 'Foo' );
54 my $foo = Foo->load($file);
58 "ネットスーパー (Internet Shopping)",
59 '... got the string we expected');
68 utf8_string => 'Escritório'
70 isa_ok( $foo, 'Foo' );
76 my $foo = Foo->load($file);
79 ok(utf8::is_utf8($foo->utf8_string), '... the string is still utf8');
83 '... got the string we expected');