From 31a71048521224774bdb8b5982ab73eb35dad66d Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Thu, 11 Nov 2021 10:40:30 +0900 Subject: Merge RubyGems 3.2.27 and Bundler 2.2.27 --- spec/bundler/commands/check_spec.rb | 52 ++++++++++++++++++++++++++++++++++++ spec/bundler/commands/config_spec.rb | 8 ++++++ 2 files changed, 60 insertions(+) (limited to 'spec/bundler/commands') diff --git a/spec/bundler/commands/check_spec.rb b/spec/bundler/commands/check_spec.rb index c48220f8df..419deae19b 100644 --- a/spec/bundler/commands/check_spec.rb +++ b/spec/bundler/commands/check_spec.rb @@ -137,6 +137,22 @@ RSpec.describe "bundle check" do expect(exitstatus).to eq(1) end + it "ensures that gems are actually installed and not just cached in applications' cache" do + gemfile <<-G + source "#{file_uri_for(gem_repo1)}" + gem "rack" + G + + bundle "config set --local path vendor/bundle" + bundle :cache + + gem_command "uninstall rack", :env => { "GEM_HOME" => vendored_gems.to_s } + + bundle "check", :raise_on_error => false + expect(err).to include("* rack (1.0.0)") + expect(exitstatus).to eq(1) + end + it "ignores missing gems restricted to other platforms" do gemfile <<-G source "#{file_uri_for(gem_repo1)}" @@ -316,6 +332,42 @@ RSpec.describe "bundle check" do end end + describe "when locked under multiple platforms" do + before :each do + build_repo4 do + build_gem "rack" + end + + gemfile <<-G + source "#{file_uri_for(gem_repo4)}" + gem "rack" + G + + lockfile <<-L + GEM + remote: #{file_uri_for(gem_repo4)}/ + specs: + rack (1.0) + + PLATFORMS + ruby + #{specific_local_platform} + + DEPENDENCIES + rack + + BUNDLED WITH + #{Bundler::VERSION} + L + end + + it "shows what is missing with the current Gemfile without duplications" do + bundle :check, :raise_on_error => false + expect(err).to match(/The following gems are missing/) + expect(err).to include("* rack (1.0").once + end + end + describe "when using only scoped rubygems sources" do before do gemfile <<~G diff --git a/spec/bundler/commands/config_spec.rb b/spec/bundler/commands/config_spec.rb index 48f0ceab78..2d0a7dc989 100644 --- a/spec/bundler/commands/config_spec.rb +++ b/spec/bundler/commands/config_spec.rb @@ -440,6 +440,14 @@ E expect(out).to eq "gems.myserver.com=user:password\nspec_run=true" end + it "list with API token credentials" do + bundle "config list", :env => { "BUNDLE_GEMS__MYSERVER__COM" => "api_token:x-oauth-basic" } + expect(out).to eq "Settings are listed in order of priority. The top value will be used.\ngems.myserver.com\nSet via BUNDLE_GEMS__MYSERVER__COM: \"[REDACTED]:x-oauth-basic\"\n\nspec_run\nSet via BUNDLE_SPEC_RUN: \"true\"" + + bundle "config list", :parseable => true, :env => { "BUNDLE_GEMS__MYSERVER__COM" => "api_token:x-oauth-basic" } + expect(out).to eq "gems.myserver.com=api_token:x-oauth-basic\nspec_run=true" + end + it "get" do ENV["BUNDLE_BAR"] = "bar_val" -- cgit v1.2.3