summaryrefslogtreecommitdiff
path: root/spec/bundler/runtime
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2021-12-25 06:27:56 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-12-25 07:40:52 +0900
commitda6a5e3ed16ab0cdda7546dd9caf55c59be7b86f (patch)
treebd6f624e694dc6b96ce429c1100d3ab240001c19 /spec/bundler/runtime
parent2b2115318b4ee236ef61a3450bf85b16e591006d (diff)
Merge RubyGems-3.3.3 and Bundler-2.3.3
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/5342
Diffstat (limited to 'spec/bundler/runtime')
-rw-r--r--spec/bundler/runtime/self_management_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/bundler/runtime/self_management_spec.rb b/spec/bundler/runtime/self_management_spec.rb
index def9361d0f..7746a6ffa9 100644
--- a/spec/bundler/runtime/self_management_spec.rb
+++ b/spec/bundler/runtime/self_management_spec.rb
@@ -45,6 +45,29 @@ RSpec.describe "Self management", :rubygems => ">= 3.3.0.dev" do
bundle "config set --local path vendor/bundle"
bundle "install", :env => { "BUNDLER_SPEC_GEM_SOURCES" => file_uri_for(gem_repo2).to_s }
expect(out).to include("Bundler #{Bundler::VERSION} is running, but your lockfile was generated with #{next_minor}. Installing Bundler #{next_minor} and restarting using that version.")
+ expect(vendored_gems("gems/bundler-#{next_minor}")).to exist
+
+ # It does not uninstall the locked bundler
+ bundle "clean"
+ expect(out).to be_empty
+
+ # App now uses locked version
+ bundle "-v"
+ expect(out).to end_with(next_minor[0] == "2" ? "Bundler version #{next_minor}" : next_minor)
+
+ # Subsequent installs use the locked version without reinstalling
+ bundle "install --verbose"
+ expect(out).to include("Using bundler #{next_minor}")
+ expect(out).not_to include("Bundler #{Bundler::VERSION} is running, but your lockfile was generated with #{next_minor}. Installing Bundler #{next_minor} and restarting using that version.")
+ end
+
+ it "installs locked version when using deployment option and uses it" do
+ lockfile_bundled_with(next_minor)
+
+ bundle "config set --local deployment true"
+ bundle "install", :env => { "BUNDLER_SPEC_GEM_SOURCES" => file_uri_for(gem_repo2).to_s }
+ expect(out).to include("Bundler #{Bundler::VERSION} is running, but your lockfile was generated with #{next_minor}. Installing Bundler #{next_minor} and restarting using that version.")
+ expect(vendored_gems("gems/bundler-#{next_minor}")).to exist
# It does not uninstall the locked bundler
bundle "clean"