Apply patch from RT#46343
[gitmo/MooseX-Storage.git] / t / 102_io_storable_file.t
index e0a90a0..2ff5625 100644 (file)
@@ -4,6 +4,9 @@ use strict;
 use warnings;
 
 use Test::More tests => 10;
+use File::Temp qw(tempdir);
+use File::Spec::Functions;
+my $dir = tempdir( CLEANUP => 1 );
 
 BEGIN {
     use_ok('MooseX::Storage');
@@ -24,7 +27,7 @@ BEGIN {
        has 'object' => (is => 'ro', isa => 'Object');    
 }
 
-my $file = 'temp.storable';
+my $file = catfile($dir,'temp.storable');
 
 {
     my $foo = Foo->new(
@@ -54,4 +57,3 @@ my $file = 'temp.storable';
     is($foo->object->number, 2, '... got the right number (in the embedded object)');
 }
 
-unlink $file;