8 use File::Spec::Functions;
12 eval "use IO::AtomicFile";
13 plan skip_all => "IO::AtomicFile is required for this test" if $@;
15 plan skip_all => "JSON::Any is required for this test" if $@;
17 # this is because JSON::XS is
18 # the only one which really gets
22 $ENV{JSON_ANY_ORDER} = qw(XS);
23 $ENV{JSON_ANY_CONFIG} = "utf8=1";
26 use_ok('MooseX::Storage');
36 with Storage( 'format' => 'JSON', 'io' => 'AtomicFile' );
38 has 'utf8_string' => (
41 default => sub { "ネットスーパー (Internet Shopping)" }
45 my $file = catfile($dir, 'temp.json');
49 isa_ok( $foo, 'Foo' );
55 my $foo = Foo->load($file);
59 "ネットスーパー (Internet Shopping)",
60 '... got the string we expected');
69 utf8_string => 'Escritório'
71 isa_ok( $foo, 'Foo' );
77 my $foo = Foo->load($file);
80 ok(utf8::is_utf8($foo->utf8_string), '... the string is still utf8');
84 '... got the string we expected');