From b5ef64a8a129919e035c4499e946c83b22ad0101 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Tue, 1 Mar 2022 12:11:15 +0900 Subject: Merge RubyGems-3.3.8 and Bundler-2.3.8 --- spec/bundler/commands/check_spec.rb | 63 ++++++++++++++++++++++++++++ spec/bundler/other/major_deprecation_spec.rb | 4 +- 2 files changed, 65 insertions(+), 2 deletions(-) (limited to 'spec/bundler') diff --git a/spec/bundler/commands/check_spec.rb b/spec/bundler/commands/check_spec.rb index e0c9a04c25..b4996977c1 100644 --- a/spec/bundler/commands/check_spec.rb +++ b/spec/bundler/commands/check_spec.rb @@ -431,6 +431,69 @@ RSpec.describe "bundle check" do end end + context "with gemspec directive and scoped sources" do + before do + build_repo4 do + build_gem "awesome_print" + end + + build_repo2 do + build_gem "dex-dispatch-engine" + end + + build_lib("bundle-check-issue", :path => tmp.join("bundle-check-issue")) do |s| + s.write "Gemfile", <<-G + source "https://localgemserver.test" + + gemspec + + source "https://localgemserver.test/extra" do + gem "dex-dispatch-engine" + end + G + + s.add_dependency "awesome_print" + end + + bundle "install", :artifice => "compact_index_extra", :env => { "BUNDLER_SPEC_GEM_REPO" => gem_repo4.to_s }, :dir => tmp.join("bundle-check-issue") + end + + it "does not corrupt lockfile when changing version" do + version_file = tmp.join("bundle-check-issue/bundle-check-issue.gemspec") + File.write(version_file, File.read(version_file).gsub(/s\.version = .+/, "s.version = '9999'")) + + bundle "check --verbose", :dir => tmp.join("bundle-check-issue") + + expect(File.read(tmp.join("bundle-check-issue/Gemfile.lock"))).to eq <<~L + PATH + remote: . + specs: + bundle-check-issue (9999) + awesome_print + + GEM + remote: https://localgemserver.test/ + specs: + awesome_print (1.0) + + GEM + remote: https://localgemserver.test/extra/ + specs: + dex-dispatch-engine (1.0) + + PLATFORMS + #{lockfile_platforms} + + DEPENDENCIES + bundle-check-issue! + dex-dispatch-engine! + + BUNDLED WITH + #{Bundler::VERSION} + L + end + end + describe "BUNDLED WITH" do def lock_with(bundler_version = nil) lock = <<~L diff --git a/spec/bundler/other/major_deprecation_spec.rb b/spec/bundler/other/major_deprecation_spec.rb index c6490ad255..af6bbbce48 100644 --- a/spec/bundler/other/major_deprecation_spec.rb +++ b/spec/bundler/other/major_deprecation_spec.rb @@ -352,7 +352,7 @@ RSpec.describe "major deprecations" do G expect(warnings).to include( - "Multiple gemfiles (gems.rb and Gemfile) detected. Make sure you remove Gemfile and Gemfile.lock since bundler is ignoring them in favor of gems.rb and gems.rb.locked." + "Multiple gemfiles (gems.rb and Gemfile) detected. Make sure you remove Gemfile and Gemfile.lock since bundler is ignoring them in favor of gems.rb and gems.locked." ) expect(the_bundle).not_to include_gem "rack 1.0" @@ -512,7 +512,7 @@ RSpec.describe "major deprecations" do it "should print a single deprecation warning" do expect(warnings).to include( - "Multiple gemfiles (gems.rb and Gemfile) detected. Make sure you remove Gemfile and Gemfile.lock since bundler is ignoring them in favor of gems.rb and gems.rb.locked." + "Multiple gemfiles (gems.rb and Gemfile) detected. Make sure you remove Gemfile and Gemfile.lock since bundler is ignoring them in favor of gems.rb and gems.locked." ) end end -- cgit v1.2.3