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
This commit is contained in:
parent
8e6259e0d9
commit
e0cc69b74e
@ -123,7 +123,9 @@ class TestFileUtils < Test::Unit::TestCase
|
|||||||
|
|
||||||
def my_rm_rf(path)
|
def my_rm_rf(path)
|
||||||
if File.exist?('/bin/rm')
|
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
|
else
|
||||||
FileUtils.rm_rf path
|
FileUtils.rm_rf path
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user