aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-12-12 20:53:59 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-12-12 20:53:59 +0900
commitdd60856f8ddaa0652bf019589f05705e00279b8c (patch)
treebb2de9819893114438bda7c40bfb405067534c01 /test
parentb6f25318c5a1efca0ab963b49ae69db82787e783 (diff)
downloadruby-dd60856f8ddaa0652bf019589f05705e00279b8c.tar.gz
[cygwin] fix File.absolute_path? test
Paths start with the root are absolute on cygwin, regardless the drive letter.
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_file.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/ruby/test_file.rb b/test/ruby/test_file.rb
index 02f7464599..96e2ca291f 100644
--- a/test/ruby/test_file.rb
+++ b/test/ruby/test_file.rb
@@ -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