diff options
Diffstat (limited to 'test/fileutils/test_fileutils.rb')
-rw-r--r-- | test/fileutils/test_fileutils.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb index 49e637d83b..297b709fb4 100644 --- a/test/fileutils/test_fileutils.rb +++ b/test/fileutils/test_fileutils.rb @@ -37,7 +37,7 @@ class TestFileUtils < Test::Unit::TestCase def my_rm_rf( path ) if File.exist?('/bin/rm') - system "/bin/rm -rf #{path}" + system %Q[/bin/rm -rf "#{path}"] else FileUtils.rm_rf path end @@ -45,7 +45,9 @@ class TestFileUtils < Test::Unit::TestCase def setup @prevdir = Dir.pwd - Dir.chdir Dir.tmpdir + tmproot = "#{Dir.tmpdir}/fileutils.rb.#{$$}" + Dir.mkdir tmproot unless File.directory?(tmproot) + Dir.chdir tmproot my_rm_rf 'data'; Dir.mkdir 'data' my_rm_rf 'tmp'; Dir.mkdir 'tmp' prepare_data_file @@ -53,9 +55,9 @@ class TestFileUtils < Test::Unit::TestCase end def teardown - my_rm_rf 'data' - my_rm_rf 'tmp' + tmproot = Dir.pwd Dir.chdir @prevdir + my_rm_rf tmproot end |