[rubygems/rubygems] Unify java_platform? to Gem.java_platform?

https://github.com/rubygems/rubygems/commit/7f27ab32b8
This commit is contained in:
Hiroshi SHIBATA 2023-04-05 10:45:46 +09:00 committed by git
parent bf8afe434f
commit cbeea5f3e6
7 changed files with 11 additions and 25 deletions

View File

@ -1145,20 +1145,6 @@ Also, a list:
self.class.win_platform? self.class.win_platform?
end end
##
# Is this test being run on a Java platform?
def self.java_platform?
Gem.java_platform?
end
##
# see ::java_platform?
def java_platform?
self.class.java_platform?
end
## ##
# Returns whether or not we're on a version of Ruby built with VC++ (or # Returns whether or not we're on a version of Ruby built with VC++ (or
# Borland) versus Cygwin, Mingw, etc. # Borland) versus Cygwin, Mingw, etc.

View File

@ -593,7 +593,7 @@ class TestGemCommandsBuildCommand < Gem::TestCase
end end
def test_build_signed_gem def test_build_signed_gem
pend "openssl is missing" unless Gem::HAVE_OPENSSL && !java_platform? pend "openssl is missing" unless Gem::HAVE_OPENSSL && !Gem.java_platform?
trust_dir = Gem::Security.trust_dir trust_dir = Gem::Security.trust_dir
@ -620,7 +620,7 @@ class TestGemCommandsBuildCommand < Gem::TestCase
end end
def test_build_signed_gem_with_cert_expiration_length_days def test_build_signed_gem_with_cert_expiration_length_days
pend "openssl is missing" unless Gem::HAVE_OPENSSL && !java_platform? pend "openssl is missing" unless Gem::HAVE_OPENSSL && !Gem.java_platform?
gem_path = File.join Gem.user_home, ".gem" gem_path = File.join Gem.user_home, ".gem"
Dir.mkdir gem_path Dir.mkdir gem_path
@ -664,7 +664,7 @@ class TestGemCommandsBuildCommand < Gem::TestCase
end end
def test_build_auto_resign_cert def test_build_auto_resign_cert
pend "openssl is missing" unless Gem::HAVE_OPENSSL && !java_platform? pend "openssl is missing" unless Gem::HAVE_OPENSSL && !Gem.java_platform?
gem_path = File.join Gem.user_home, ".gem" gem_path = File.join Gem.user_home, ".gem"
Dir.mkdir gem_path Dir.mkdir gem_path

View File

@ -140,7 +140,7 @@ class TestGemExtCargoBuilder < Gem::TestCase
private private
def skip_unsupported_platforms! def skip_unsupported_platforms!
pend "jruby not supported" if java_platform? pend "jruby not supported" if Gem.java_platform?
pend "truffleruby not supported (yet)" if RUBY_ENGINE == "truffleruby" pend "truffleruby not supported (yet)" if RUBY_ENGINE == "truffleruby"
system(@rust_envs, "cargo", "-V", out: IO::NULL, err: [:child, :out]) system(@rust_envs, "cargo", "-V", out: IO::NULL, err: [:child, :out])
pend "cargo not present" unless $?.success? pend "cargo not present" unless $?.success?

View File

@ -55,6 +55,6 @@ class TestGemExtCargoBuilderUnit < Gem::TestCase
end end
def skip_unsupported_platforms! def skip_unsupported_platforms!
pend "jruby not supported" if java_platform? pend "jruby not supported" if Gem.java_platform?
end end
end end

View File

@ -15,7 +15,7 @@ class TestGemExtExtConfBuilder < Gem::TestCase
end end
def test_class_build def test_class_build
if java_platform? if Gem.java_platform?
pend("failing on jruby") pend("failing on jruby")
end end
@ -45,7 +45,7 @@ class TestGemExtExtConfBuilder < Gem::TestCase
end end
def test_class_build_rbconfig_make_prog def test_class_build_rbconfig_make_prog
if java_platform? if Gem.java_platform?
pend("failing on jruby") pend("failing on jruby")
end end
@ -72,7 +72,7 @@ class TestGemExtExtConfBuilder < Gem::TestCase
env_MAKE = ENV.delete "MAKE" env_MAKE = ENV.delete "MAKE"
ENV["MAKE"] = "anothermake" ENV["MAKE"] = "anothermake"
if java_platform? if Gem.java_platform?
pend("failing on jruby") pend("failing on jruby")
end end

View File

@ -36,7 +36,7 @@ class TestGemUtil < Gem::TestCase
end end
def test_traverse_parents_does_not_crash_on_permissions_error def test_traverse_parents_does_not_crash_on_permissions_error
pend "skipped on MS Windows (chmod has no effect)" if win_platform? || java_platform? pend "skipped on MS Windows (chmod has no effect)" if win_platform? || Gem.java_platform?
FileUtils.mkdir_p "d/e/f" FileUtils.mkdir_p "d/e/f"
# remove 'execute' permission from "e" directory and make it # remove 'execute' permission from "e" directory and make it
@ -53,7 +53,7 @@ class TestGemUtil < Gem::TestCase
assert_equal File.realpath("../..", @tempdir), paths[3] assert_equal File.realpath("../..", @tempdir), paths[3]
ensure ensure
# restore default permissions, allow the directory to be removed # restore default permissions, allow the directory to be removed
FileUtils.chmod(0775, "d/e") unless win_platform? || java_platform? FileUtils.chmod(0775, "d/e") unless win_platform? || Gem.java_platform?
end end
def test_glob_files_in_dir def test_glob_files_in_dir

View File

@ -225,7 +225,7 @@ class TestGemRequire < Gem::TestCase
pend "Not sure what's going on. If another spec creates a 'a' gem before pend "Not sure what's going on. If another spec creates a 'a' gem before
this test, somehow require will load the benchmark in b, and ignore that the this test, somehow require will load the benchmark in b, and ignore that the
stdlib one is already in $LOADED_FEATURES?. Reproducible by running the stdlib one is already in $LOADED_FEATURES?. Reproducible by running the
spaceship_specific_file test before this one" if java_platform? spaceship_specific_file test before this one" if Gem.java_platform?
pend "not installed yet" unless RbConfig::TOPDIR pend "not installed yet" unless RbConfig::TOPDIR