From 360fead27bf83ab7746be2e88ed800263392e8a0 Mon Sep 17 00:00:00 2001 From: aamine Date: Tue, 25 Nov 2003 11:02:30 +0000 Subject: * test/fileutils/test_fileutils.rb: do test in more deep directory. * test/fileutils/test_nowrite.rb: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/fileutils/test_fileutils.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'test/fileutils/test_fileutils.rb') diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb index 49e637d83..297b709fb 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 -- cgit