7 use File::Temp qw(tempdir);
8 use File::Spec::Functions;
9 my $dir = tempdir( CLEANUP => 1 );
13 plan skip_all => "JSON::Any is required for this test" if $@;
15 # this is because JSON::XS is
16 # the only one which really gets
20 $ENV{JSON_ANY_ORDER} = qw(XS);
21 $ENV{JSON_ANY_CONFIG} = "utf8=1";
24 use_ok('MooseX::Storage');
34 with Storage( 'format' => 'JSON', 'io' => 'File' );
36 has 'utf8_string' => (
39 default => sub { "ネットスーパー (Internet Shopping)" }
43 my $file = catfile($dir,'temp.json');
47 isa_ok( $foo, 'Foo' );
53 my $foo = Foo->load($file);
57 "ネットスーパー (Internet Shopping)",
58 '... got the string we expected');
67 utf8_string => 'Escritório'
69 isa_ok( $foo, 'Foo' );
75 my $foo = Foo->load($file);
78 ok(utf8::is_utf8($foo->utf8_string), '... the string is still utf8');
82 '... got the string we expected');