X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F100_io.t;h=610eaa9d4b09c4a94b51da770c03d49910591674;hb=cd4cef76da2af19af449e8c4c366e3111c6530ba;hp=130f4b7e1e35b4baa616cf9b88e9eba70ad6b2b1;hpb=ba5bba75ba0c4f8af075e95ce3b00e5376bedf5c;p=gitmo%2FMooseX-Storage.git diff --git a/t/100_io.t b/t/100_io.t index 130f4b7..610eaa9 100644 --- a/t/100_io.t +++ b/t/100_io.t @@ -3,9 +3,17 @@ use strict; use warnings; -use Test::More no_plan => 1; +use Test::More; +use File::Temp qw(tempdir); +use File::Spec::Functions; +my $dir = tempdir; + +use Test::Requires { + 'JSON::Any' => 0.01, # skip all if not installed +}; BEGIN { + plan tests => 10; use_ok('MooseX::Storage'); } @@ -24,7 +32,7 @@ BEGIN { has 'object' => (is => 'ro', isa => 'Object'); } -my $file = 'temp.json'; +my $file = catfile( $dir, 'temp.json' ); { my $foo = Foo->new( @@ -54,4 +62,3 @@ my $file = 'temp.json'; is($foo->object->number, 2, '... got the right number (in the embedded object)'); } -unlink $file;