mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[cygwin] fix File.absolute_path? test
Paths start with the root are absolute on cygwin, regardless the drive letter.
This commit is contained in:
parent
b6f25318c5
commit
dd60856f8d
1 changed files with 5 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue