[cygwin] fix File.absolute_path? test

Paths start with the root are absolute on cygwin, regardless the
drive letter.
This commit is contained in:
Nobuyoshi Nakada 2019-12-12 20:53:59 +09:00
Родитель b6f25318c5
Коммит dd60856f8d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4BC7D6DF58D8DF60
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -501,13 +501,16 @@ class TestFile < Test::Unit::TestCase
assert_file.not_absolute_path?("~")
assert_file.not_absolute_path?("~user")
if /mswin|mingw/ =~ RUBY_PLATFORM
if /cygwin|mswin|mingw/ =~ RUBY_PLATFORM
assert_file.absolute_path?("C:\\foo\\bar")
assert_file.absolute_path?("C:/foo/bar")
assert_file.not_absolute_path?("/foo/bar\\baz")
else
assert_file.not_absolute_path?("C:\\foo\\bar")
assert_file.not_absolute_path?("C:/foo/bar")
end
if /mswin|mingw/ =~ RUBY_PLATFORM
assert_file.not_absolute_path?("/foo/bar\\baz")
else
assert_file.absolute_path?("/foo/bar\\baz")
end
end