Author: jkeenan Date: Sat Dec 20 20:21:17 2008 New Revision: 34177 Modified: trunk/t/perl/Parrot_IO.t
Log: Applying patch submitted by Ron Schmidt in http://rt.perl.org/rt3/Ticket/Display.html?id=57320. All tests continue to pass. Let's see if this resolves temp directory problem. Modified: trunk/t/perl/Parrot_IO.t ============================================================================== --- trunk/t/perl/Parrot_IO.t (original) +++ trunk/t/perl/Parrot_IO.t Sat Dec 20 20:21:17 2008 @@ -10,6 +10,7 @@ use Parrot::Distribution; use File::Spec::Functions ':ALL'; +use File::Temp qw/tempdir/; =head1 NAME @@ -38,6 +39,14 @@ # can do with it. BEGIN { use_ok('Parrot::IO::Path') } +my $file_temp_work_path = tempdir( + 'PARROT_IO_XXXX', + TMPDIR => 1, + CLEANUP => 1 +); +# you can sort of count on the var below being the unique part of the temp dir +my $file_temp_dir = (splitdir($file_temp_work_path))[-1]; + my $suffix = 'txt'; my $name = 'file'; my $fullname = join '.', $name, $suffix; @@ -79,7 +88,9 @@ isa_ok( $r, 'Parrot::IO::Directory' ); ok( !$r->parent(), 'root has no parent' ); -my $d = Parrot::IO::Directory->tmp_directory('t'); +my $d = Parrot::IO::Directory->tmp_directory( + catfile($file_temp_dir, 't') +); ok( $d, 'tmp_directory' ); # Create a file in a directory that does not exist. @@ -90,7 +101,7 @@ my $d2 = $d1->directory_with_name('two'); ok( $d1 && $d2, 'directory_with_name' ); -my $f = Parrot::IO::File->tmp_file($fullname); +my $f = Parrot::IO::File->tmp_file(catfile($file_temp_dir, $fullname)); ok( $f, 'tmp_file' ); # Check the instance got re-blessed. @@ -201,7 +212,7 @@ # tmp_dir_path(@dirs) sub tmp_dir_path { - return catdir( tmpdir, @_ ); + return catdir( $file_temp_work_path, @_ ); } # tmp_file_path(@dirs, $file)
