summaryrefslogtreecommitdiff
path: root/test/fileutils/test_fileutils.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/fileutils/test_fileutils.rb')
-rw-r--r--test/fileutils/test_fileutils.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb
index 5d029c919c..5c5a2c2ea8 100644
--- a/test/fileutils/test_fileutils.rb
+++ b/test/fileutils/test_fileutils.rb
@@ -895,6 +895,24 @@ class TestFileUtils < Test::Unit::TestCase
mkdir_p '/'
end
+ if /mswin|mingw|cygwin/ =~ RUBY_PLATFORM
+ def test_mkdir_p_root
+ if /cygwin/ =~ RUBY_PLATFORM
+ tmpdir = `cygpath -ma .`.chomp
+ else
+ tmpdir = Dir.pwd
+ end
+ skip "No drive letter" unless /\A[a-z]:/i =~ tmpdir
+ drive = "./#{$&}"
+ assert_file_not_exist drive
+ mkdir_p "#{tmpdir}/none/dir"
+ assert_directory "none/dir"
+ assert_file_not_exist drive
+ ensure
+ Dir.rmdir(drive) if drive and File.directory?(drive)
+ end
+ end
+
def test_mkdir_p_file_perm
mkdir_p 'tmp/tmp/tmp', :mode => 07777
assert_directory 'tmp/tmp/tmp'