use warnings;
use Test::More;
+use File::Temp qw(tempdir);
+use File::Spec::Functions;
+my $dir = tempdir( CLEANUP => 1 );
BEGIN {
+ eval "use JSON::Any";
+ plan skip_all => "JSON::Any is required for this test" if $@;
# NOTE:
# this is because JSON::XS is
# the only one which really gets
);
}
-my $file = 'temp.json';
+my $file = catfile($dir,'temp.json');
{
my $foo = Foo->new;
'... got the string we expected');
}
-unlink $file;