diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-12-14 21:14:58 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-12-15 18:05:18 +0900 |
commit | 7e084ed707310139b351f6d30af435676422af62 (patch) | |
tree | db7450ae96ccd8d90287e33412769230da247242 /test | |
parent | 583e06e28f5ed4078393000f929f4380777ba972 (diff) | |
download | ruby-7e084ed707310139b351f6d30af435676422af62.tar.gz |
Merge RubyGems and Bundler master
Merge from https://github.com/rubygems/rubygems/commit/793ad95ecb40e84a1dcb4cb60f2686843ed90de5
Diffstat (limited to 'test')
-rw-r--r-- | test/rubygems/test_gem_specification.rb | 6 | ||||
-rw-r--r-- | test/rubygems/test_project_sanity.rb | 12 | ||||
-rw-r--r-- | test/rubygems/test_rubygems.rb | 23 |
3 files changed, 26 insertions, 15 deletions
diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb index bfd0db347e..375bacf9bd 100644 --- a/test/rubygems/test_gem_specification.rb +++ b/test/rubygems/test_gem_specification.rb @@ -944,7 +944,7 @@ dependencies: [] end def test_self_outdated_and_latest_remotes - specs = spec_fetcher do |fetcher| + spec_fetcher do |fetcher| fetcher.download 'a', 4 fetcher.download 'b', 3 @@ -953,8 +953,8 @@ dependencies: [] end expected = [ - [specs['a-3.a'], v(4)], - [specs['b-2'], v(3)], + [Gem::Specification.stubs.find {|s| s.full_name == 'a-3.a' }, v(4)], + [Gem::Specification.stubs.find {|s| s.full_name == 'b-2' }, v(3)], ] assert_equal expected, Gem::Specification.outdated_and_latest_version.to_a diff --git a/test/rubygems/test_project_sanity.rb b/test/rubygems/test_project_sanity.rb index 4324c997bd..38c2541df6 100644 --- a/test/rubygems/test_project_sanity.rb +++ b/test/rubygems/test_project_sanity.rb @@ -17,16 +17,4 @@ class TestProjectSanity < Gem::TestCase assert status.success?, err end - - def test_require_and_use_rubygems_version - err, status = Open3.capture2e( - *ruby_with_rubygems_in_load_path, - "--disable-gems", - "-rrubygems/version", - "-e", - "Gem::Version.new('2.7.0.preview1') >= Gem::Version.new(RUBY_VERSION)" - ) - - assert status.success?, err - end end diff --git a/test/rubygems/test_rubygems.rb b/test/rubygems/test_rubygems.rb index 493b9fdf4a..fa77a29932 100644 --- a/test/rubygems/test_rubygems.rb +++ b/test/rubygems/test_rubygems.rb @@ -22,6 +22,29 @@ class GemTest < Gem::TestCase "the problem and ask for help." end + def test_operating_system_customizing_default_dir + pend "does not apply to truffleruby" if RUBY_ENGINE == 'truffleruby' + pend "loads a custom defaults/jruby file that gets in the middle" if RUBY_ENGINE == 'jruby' + + # On a non existing default dir, there should be no gems + + path = util_install_operating_system_rb <<-RUBY + module Gem + def self.default_dir + File.expand_path("foo") + end + end + RUBY + + output = Gem::Util.popen( + *ruby_with_rubygems_and_fake_operating_system_in_load_path(path), + '-e', + "require \"rubygems\"; puts Gem::Specification.stubs.map(&:full_name)", + {:err => [:child, :out]} + ).strip + assert_empty output + end + private def util_install_operating_system_rb(content) |