From e0cc69b74e99dd1f8ce4d9b92c255a2205fefaa4 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 26 Aug 2015 08:11:58 +0000 Subject: [PATCH] test_fileutils.rb: improve my_rm_rf * test/fileutils/test_fileutils.rb (my_rm_rf): get rid of special chars and remove by rmdir on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/fileutils/test_fileutils.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb index 295fbfd960..5f1cc41e3a 100644 --- a/test/fileutils/test_fileutils.rb +++ b/test/fileutils/test_fileutils.rb @@ -123,7 +123,9 @@ class TestFileUtils < Test::Unit::TestCase def my_rm_rf(path) if File.exist?('/bin/rm') - system %Q[/bin/rm -rf "#{path}"] + system "/bin/rm", "-rf", path + elsif /mswin|mingw/ =~ RUBY_PLATFORM + system "rmdir", "/q/s", path.gsub('/', '\\'), err: IO::NULL else FileUtils.rm_rf path end