summaryrefslogtreecommitdiff
path: root/spec/bundler/commands
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2021-11-11 10:40:30 +0900
committernagachika <nagachika@ruby-lang.org>2021-11-22 10:51:35 +0900
commit31a71048521224774bdb8b5982ab73eb35dad66d (patch)
tree8174af2f04f4b31abf0f4ab08d779055f513cdaa /spec/bundler/commands
parent6d540c1b9844a5832846618b53ce35d12d64deac (diff)
Merge RubyGems 3.2.27 and Bundler 2.2.27
Diffstat (limited to 'spec/bundler/commands')
-rw-r--r--spec/bundler/commands/check_spec.rb52
-rw-r--r--spec/bundler/commands/config_spec.rb8
2 files changed, 60 insertions, 0 deletions
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"