summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_util.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2019-06-01 12:45:11 +0300
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-06-01 13:50:41 +0300
commit56660de3c6df7a4ff8667ef4047d30d0de169935 (patch)
treedd1e526075687b4b24e089cee50eabc21a6143cc /test/rubygems/test_gem_util.rb
parent560cd5b1f04f30542a294b3d77527d3b12f7cc15 (diff)
Merge rubygems master from upstream.
I picked the commit from 3c469e0da538428a0ddd94f99aa73c32da22e8ba
Diffstat (limited to 'test/rubygems/test_gem_util.rb')
-rw-r--r--test/rubygems/test_gem_util.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/test/rubygems/test_gem_util.rb b/test/rubygems/test_gem_util.rb
index a48d275d28..3f1d069a20 100644
--- a/test/rubygems/test_gem_util.rb
+++ b/test/rubygems/test_gem_util.rb
@@ -5,6 +5,7 @@ require 'rubygems/util'
class TestGemUtil < Gem::TestCase
def test_class_popen
+ skip "popen with a block does not behave well on jruby" if Gem.java_platform?
assert_equal "0\n", Gem::Util.popen(Gem.ruby, '-I', File.expand_path('../../../lib', __FILE__), '-e', 'p 0')
assert_raises Errno::ECHILD do
@@ -13,6 +14,7 @@ class TestGemUtil < Gem::TestCase
end
def test_silent_system
+ skip if Gem.java_platform?
assert_silent do
Gem::Util.silent_system Gem.ruby, '-I', File.expand_path('../../../lib', __FILE__), '-e', 'puts "hello"; warn "hello"'
end
@@ -30,7 +32,7 @@ class TestGemUtil < Gem::TestCase
end
def test_traverse_parents_does_not_crash_on_permissions_error
- skip 'skipped on MS Windows (chmod has no effect)' if win_platform?
+ skip 'skipped on MS Windows (chmod has no effect)' if win_platform? || java_platform?
FileUtils.mkdir_p 'd/e/f'
# remove 'execute' permission from "e" directory and make it
@@ -47,7 +49,7 @@ class TestGemUtil < Gem::TestCase
assert_equal File.realpath("..", Dir.tmpdir), paths[3]
ensure
# restore default permissions, allow the directory to be removed
- FileUtils.chmod(0775, 'd/e') unless win_platform?
+ FileUtils.chmod(0775, 'd/e') unless win_platform? || java_platform?
end
def test_linked_list_find
@@ -75,4 +77,12 @@ class TestGemUtil < Gem::TestCase
assert_equal expected_paths.to_set, files_with_relative_base.to_set
end
+ def test_correct_for_windows_path
+ path = "/C:/WINDOWS/Temp/gems"
+ assert_equal "C:/WINDOWS/Temp/gems", Gem::Util.correct_for_windows_path(path)
+
+ path = "/home/skillet"
+ assert_equal "/home/skillet", Gem::Util.correct_for_windows_path(path)
+ end
+
end