From 7e42e5c01b007e19c2af3000d519b93526e53d4f Mon Sep 17 00:00:00 2001 From: aamine Date: Tue, 25 Nov 2003 11:02:30 +0000 Subject: [PATCH] * test/fileutils/test_fileutils.rb: do test in more deep directory. * test/fileutils/test_nowrite.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ test/fileutils/test_fileutils.rb | 10 ++++++---- test/fileutils/test_nowrite.rb | 12 +++++++----- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index f68b3cbc4e..9db2789209 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Tue Nov 25 20:02:14 2003 Minero Aoki + + * test/fileutils/test_fileutils.rb: do test in more deep + directory. + + * test/fileutils/test_nowrite.rb: ditto. + Tue Nov 25 19:04:23 2003 Tanaka Akira * lib/open-uri.rb (URI::Generic#find_proxy): ENV case sensitivity test 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 diff --git a/test/fileutils/test_nowrite.rb b/test/fileutils/test_nowrite.rb index 830fd83c9e..18c00b8e08 100644 --- a/test/fileutils/test_nowrite.rb +++ b/test/fileutils/test_nowrite.rb @@ -16,7 +16,7 @@ class TestNoWrite < 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 @@ -27,17 +27,19 @@ class TestNoWrite < Test::Unit::TestCase def setup @prevdir = Dir.pwd - Dir.chdir Dir.tmpdir - my_rm_rf 'date'; Dir.mkdir 'data' + 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' File.open(SRC, 'w') {|f| f.puts 'dummy' } File.open(COPY, 'w') {|f| f.puts 'dummy' } end def teardown - my_rm_rf 'data' - my_rm_rf 'tmp' + tmproot = Dir.pwd Dir.chdir @prevdir + my_rm_rf tmproot end def test_cp