From fb1ab27f535833f1ba1648d7cdce4cc893e36d07 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Thu, 23 Dec 2021 09:21:36 +0900 Subject: Merge RubyGems-3.3.1 and Bundler-2.3.1 --- spec/bundler/install/gems/standalone_spec.rb | 2 +- spec/bundler/realworld/mirror_probe_spec.rb | 33 +++++++++----------------- spec/bundler/runtime/gem_tasks_spec.rb | 6 ++--- spec/bundler/support/artifice/compact_index.rb | 2 +- spec/bundler/support/artifice/endpoint.rb | 2 +- spec/bundler/support/artifice/endpoint_500.rb | 2 +- spec/bundler/support/artifice/windows.rb | 2 +- spec/bundler/support/builders.rb | 2 +- spec/bundler/support/helpers.rb | 2 +- spec/bundler/support/path.rb | 4 ++++ spec/bundler/support/rubygems_ext.rb | 9 +++---- 11 files changed, 30 insertions(+), 36 deletions(-) (limited to 'spec/bundler') diff --git a/spec/bundler/install/gems/standalone_spec.rb b/spec/bundler/install/gems/standalone_spec.rb index faefda25f4..337d5f021c 100644 --- a/spec/bundler/install/gems/standalone_spec.rb +++ b/spec/bundler/install/gems/standalone_spec.rb @@ -116,7 +116,7 @@ RSpec.shared_examples "bundle install --standalone" do realworld_system_gems "fiddle --version 1.0.8", "tsort --version 0.1.0" necessary_system_gems = ["optparse --version 0.1.1", "psych --version 3.3.2", "yaml --version 0.1.1", "logger --version 1.4.3", "etc --version 1.2.0", "stringio --version 3.0.0"] - necessary_system_gems += ["shellwords --version 0.1.0", "base64 --version 0.1.0", "resolv --version 0.2.1"] if Gem.rubygems_version < Gem::Version.new("3.3.3.a") + necessary_system_gems += ["shellwords --version 0.1.0", "base64 --version 0.1.0", "resolv --version 0.2.1"] if Gem.rubygems_version < Gem::Version.new("3.3.a") realworld_system_gems(*necessary_system_gems, :path => scoped_gem_path(bundled_app("bundle"))) build_gem "foo", "1.0.0", :to_system => true, :default => true do |s| diff --git a/spec/bundler/realworld/mirror_probe_spec.rb b/spec/bundler/realworld/mirror_probe_spec.rb index b5aaf676e9..241424d4d6 100644 --- a/spec/bundler/realworld/mirror_probe_spec.rb +++ b/spec/bundler/realworld/mirror_probe_spec.rb @@ -74,25 +74,12 @@ RSpec.describe "fetching dependencies with a not available mirror", :realworld = bundle :install, :artifice => nil, :raise_on_error => false expect(out).to include("Fetching source index from #{mirror}") - expect(err).to include("Retrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from #{mirror}/ due to underlying error nil, :raise_on_error => false - - expect(out).to include "Fetching source index from #{mirror}/" - expect(err).to include "Retrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from #{mirror}/ due to underlying error nil, :raise_on_error => false expect(out).to include("Fetching source index from #{mirror}") - expect(err).to include("Retrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from #{mirror}/ due to underlying error { "GEM_HOME" => system_gem_path.to_s } end @@ -44,7 +44,7 @@ RSpec.describe "require 'bundler/gem_tasks'" do end it "defines a working `rake install` task", :ruby_repo do - with_gem_path_as(base_system_gems.to_s) do + with_gem_path_as(base_system_gem_path.to_s) do sys_exec "#{rake} install", :env => { "GEM_HOME" => system_gem_path.to_s } end @@ -98,7 +98,7 @@ RSpec.describe "require 'bundler/gem_tasks'" do end it "adds 'pkg' to rake/clean's CLOBBER" do - with_gem_path_as(base_system_gems.to_s) do + with_gem_path_as(base_system_gem_path.to_s) do sys_exec %(#{rake} -e 'load "Rakefile"; puts CLOBBER.inspect'), :env => { "GEM_HOME" => system_gem_path.to_s } end expect(out).to eq '["pkg"]' diff --git a/spec/bundler/support/artifice/compact_index.rb b/spec/bundler/support/artifice/compact_index.rb index 1b314e89ef..fb068fa9b5 100644 --- a/spec/bundler/support/artifice/compact_index.rb +++ b/spec/bundler/support/artifice/compact_index.rb @@ -2,7 +2,7 @@ require_relative "endpoint" -$LOAD_PATH.unshift Dir[Spec::Path.base_system_gems.join("gems/compact_index*/lib")].first.to_s +$LOAD_PATH.unshift Dir[Spec::Path.base_system_gem_path.join("gems/compact_index*/lib")].first.to_s require "compact_index" class CompactIndexAPI < Endpoint diff --git a/spec/bundler/support/artifice/endpoint.rb b/spec/bundler/support/artifice/endpoint.rb index 4a820e5a3f..c00113b28f 100644 --- a/spec/bundler/support/artifice/endpoint.rb +++ b/spec/bundler/support/artifice/endpoint.rb @@ -2,7 +2,7 @@ require_relative "../path" -$LOAD_PATH.unshift(*Dir[Spec::Path.base_system_gems.join("gems/{artifice,mustermann,rack,tilt,sinatra,ruby2_keywords}-*/lib")].map(&:to_s)) +$LOAD_PATH.unshift(*Dir[Spec::Path.base_system_gem_path.join("gems/{artifice,mustermann,rack,tilt,sinatra,ruby2_keywords}-*/lib")].map(&:to_s)) require "artifice" require "sinatra/base" diff --git a/spec/bundler/support/artifice/endpoint_500.rb b/spec/bundler/support/artifice/endpoint_500.rb index 0ce8dfeaad..a0d850a44d 100644 --- a/spec/bundler/support/artifice/endpoint_500.rb +++ b/spec/bundler/support/artifice/endpoint_500.rb @@ -2,7 +2,7 @@ require_relative "../path" -$LOAD_PATH.unshift(*Dir[Spec::Path.base_system_gems.join("gems/{artifice,mustermann,rack,tilt,sinatra,ruby2_keywords}-*/lib")].map(&:to_s)) +$LOAD_PATH.unshift(*Dir[Spec::Path.base_system_gem_path.join("gems/{artifice,mustermann,rack,tilt,sinatra,ruby2_keywords}-*/lib")].map(&:to_s)) require "artifice" require "sinatra/base" diff --git a/spec/bundler/support/artifice/windows.rb b/spec/bundler/support/artifice/windows.rb index ddbbd62b96..674470688d 100644 --- a/spec/bundler/support/artifice/windows.rb +++ b/spec/bundler/support/artifice/windows.rb @@ -2,7 +2,7 @@ require_relative "../path" -$LOAD_PATH.unshift(*Dir[Spec::Path.base_system_gems.join("gems/{artifice,mustermann,rack,tilt,sinatra,ruby2_keywords}-*/lib")].map(&:to_s)) +$LOAD_PATH.unshift(*Dir[Spec::Path.base_system_gem_path.join("gems/{artifice,mustermann,rack,tilt,sinatra,ruby2_keywords}-*/lib")].map(&:to_s)) require "artifice" require "sinatra/base" diff --git a/spec/bundler/support/builders.rb b/spec/bundler/support/builders.rb index 90e9cbb242..aca31638ac 100644 --- a/spec/bundler/support/builders.rb +++ b/spec/bundler/support/builders.rb @@ -259,7 +259,7 @@ module Spec @_build_path = "#{path}/gems" @_build_repo = File.basename(path) yield - with_gem_path_as Path.base_system_gems do + with_gem_path_as Path.base_system_gem_path do gem_command :generate_index, :dir => path end ensure diff --git a/spec/bundler/support/helpers.rb b/spec/bundler/support/helpers.rb index 5238c8b980..99baec24d4 100644 --- a/spec/bundler/support/helpers.rb +++ b/spec/bundler/support/helpers.rb @@ -545,7 +545,7 @@ module Spec def require_rack # need to hack, so we can require rack old_gem_home = ENV["GEM_HOME"] - ENV["GEM_HOME"] = Spec::Path.base_system_gems.to_s + ENV["GEM_HOME"] = Spec::Path.base_system_gem_path.to_s require "rack" ENV["GEM_HOME"] = old_gem_home end diff --git a/spec/bundler/support/path.rb b/spec/bundler/support/path.rb index a73b3e699e..3304c69c78 100644 --- a/spec/bundler/support/path.rb +++ b/spec/bundler/support/path.rb @@ -146,6 +146,10 @@ module Spec bundled_app("Gemfile.lock") end + def base_system_gem_path + scoped_gem_path(base_system_gems) + end + def base_system_gems tmp.join("gems/base") end diff --git a/spec/bundler/support/rubygems_ext.rb b/spec/bundler/support/rubygems_ext.rb index 9389543a0f..62ba4d56c4 100644 --- a/spec/bundler/support/rubygems_ext.rb +++ b/spec/bundler/support/rubygems_ext.rb @@ -59,15 +59,13 @@ module Spec Gem.clear_paths ENV["BUNDLE_PATH"] = nil - ENV["GEM_HOME"] = ENV["GEM_PATH"] = Path.base_system_gems.to_s + ENV["GEM_HOME"] = ENV["GEM_PATH"] = Path.base_system_gem_path.to_s ENV["PATH"] = [Path.system_gem_path.join("bin"), ENV["PATH"]].join(File::PATH_SEPARATOR) ENV["PATH"] = [Path.bindir, ENV["PATH"]].join(File::PATH_SEPARATOR) if Path.ruby_core? end def install_test_deps - setup_test_paths - - install_gems(test_gemfile) + install_gems(test_gemfile, Path.base_system_gems.to_s) install_gems(rubocop_gemfile, Path.rubocop_gems.to_s) install_gems(standard_gemfile, Path.standard_gems.to_s) end @@ -109,7 +107,9 @@ module Spec def install_gems(gemfile, path = nil) old_gemfile = ENV["BUNDLE_GEMFILE"] + old_orig_gemfile = ENV["BUNDLER_ORIG_BUNDLE_GEMFILE"] ENV["BUNDLE_GEMFILE"] = gemfile.to_s + ENV["BUNDLER_ORIG_BUNDLE_GEMFILE"] = nil if path old_path = ENV["BUNDLE_PATH"] @@ -128,6 +128,7 @@ module Spec ENV["BUNDLE_PATH__SYSTEM"] = old_path__system end + ENV["BUNDLER_ORIG_BUNDLE_GEMFILE"] = old_orig_gemfile ENV["BUNDLE_GEMFILE"] = old_gemfile end -- cgit v1.2.3