diff --git a/spec/bundler/commands/update_spec.rb b/spec/bundler/commands/update_spec.rb index 2ad8d20a3b..cc1e01ba0b 100644 --- a/spec/bundler/commands/update_spec.rb +++ b/spec/bundler/commands/update_spec.rb @@ -1541,26 +1541,29 @@ RSpec.describe "bundle update --bundler" do end it "does not update the bundler version in the lockfile if the latest version is not compatible with current ruby", :ruby_repo do - pristine_system_gems "bundler-2.3.9" + pristine_system_gems "bundler-9.9.9" build_repo4 do build_gem "myrack", "1.0" - build_bundler "2.3.9" + build_bundler "9.9.9" build_bundler "999.0.0" do |s| s.required_ruby_version = "> #{Gem.ruby_version}" end end - install_gemfile <<-G, env: { "BUNDLER_IGNORE_DEFAULT_GEM" => "true" } + checksums = checksums_section do |c| + c.checksum(gem_repo4, "myrack", "1.0") + end + + install_gemfile <<-G source "https://gem.repo4" gem "myrack" G - lockfile lockfile.sub(/(^\s*)#{Bundler::VERSION}($)/, "2.3.9") - bundle :update, bundler: true, artifice: "compact_index", verbose: true, env: { "BUNDLER_SPEC_GEM_REPO" => gem_repo4.to_s, "BUNDLER_IGNORE_DEFAULT_GEM" => "true" } + bundle :update, bundler: true, artifice: "compact_index", verbose: true, env: { "BUNDLER_SPEC_GEM_REPO" => gem_repo4.to_s } - expect(out).to include("Using bundler 2.3.9") + expect(out).to include("Using bundler 9.9.9") expect(lockfile).to eq <<~L GEM @@ -1573,12 +1576,12 @@ RSpec.describe "bundle update --bundler" do DEPENDENCIES myrack - + #{checksums} BUNDLED WITH - 2.3.9 + 9.9.9 L - expect(the_bundle).to include_gems "bundler 2.3.9" + expect(the_bundle).to include_gems "bundler 9.9.9" expect(the_bundle).to include_gems "myrack 1.0" end diff --git a/spec/bundler/support/hax.rb b/spec/bundler/support/hax.rb index c7fe3637cc..492c6ca8ed 100644 --- a/spec/bundler/support/hax.rb +++ b/spec/bundler/support/hax.rb @@ -36,18 +36,4 @@ module Gem if ENV["BUNDLER_SPEC_GEM_SOURCES"] self.sources = [ENV["BUNDLER_SPEC_GEM_SOURCES"]] end - - if ENV["BUNDLER_IGNORE_DEFAULT_GEM"] - module RemoveDefaultBundlerStub - def default_stubs(pattern = "*") - super.delete_if {|stub| stub.name == "bundler" } - end - end - - class Specification - class << self - prepend RemoveDefaultBundlerStub - end - end - end end diff --git a/spec/bundler/support/helpers.rb b/spec/bundler/support/helpers.rb index df3ce0b2bb..ef52e88eed 100644 --- a/spec/bundler/support/helpers.rb +++ b/spec/bundler/support/helpers.rb @@ -170,12 +170,8 @@ module Spec requires << "#{Path.spec_dir}/support/artifice/#{artifice}.rb" end - hax_path = "#{Path.spec_dir}/support/hax.rb" + requires << "#{Path.spec_dir}/support/hax.rb" - # For specs that need to ignore the default Bundler gem, load hax before - # anything else since other stuff may actually load bundler and not skip - # the default version - env.include?("BUNDLER_IGNORE_DEFAULT_GEM") ? requires.prepend(hax_path) : requires.append(hax_path) require_option = requires.map {|r| "-r#{r}" } [env, [Gem.ruby, *lib_option, *require_option].compact.join(" ")]