diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-05-30 20:25:29 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-05-30 21:50:07 +0900 |
commit | 4bbeed61346d6016e2d72818e8068bedcb9f006d (patch) | |
tree | ddf1b23eb0e63a47efa8cc1fc0b72652e3dac354 /spec/bundler/commands/update_spec.rb | |
parent | 30b960ba345fd462f98db204f47bba66819d9884 (diff) |
Merge RubyGems/Bundler master from 4076391fce5847689bf2ec402b17133fe4e32285
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/7873
Diffstat (limited to 'spec/bundler/commands/update_spec.rb')
-rw-r--r-- | spec/bundler/commands/update_spec.rb | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/spec/bundler/commands/update_spec.rb b/spec/bundler/commands/update_spec.rb index 7016c3e19f..7a0d435860 100644 --- a/spec/bundler/commands/update_spec.rb +++ b/spec/bundler/commands/update_spec.rb @@ -659,21 +659,21 @@ RSpec.describe "bundle update" do expect(last_command).to be_failure expect(err).to match(/You are trying to install in deployment mode after changing.your Gemfile/m) - expect(err).to match(/freeze \nby running `bundle config unset deployment`./m) + expect(err).to match(/freeze \nby running `bundle config set frozen false`./m) end - it "should suggest different command when frozen is set globally", :bundler => "< 3" do + it "should fail loudly when frozen is set globally" do bundle "config set --global frozen 1" bundle "update", :all => true, :raise_on_error => false expect(err).to match(/You are trying to install in deployment mode after changing.your Gemfile/m). - and match(/freeze \nby running `bundle config unset frozen`./m) + and match(/freeze \nby running `bundle config set frozen false`./m) end - it "should suggest different command when frozen is set globally", :bundler => "3" do + it "should fail loudly when deployment is set globally" do bundle "config set --global deployment true" bundle "update", :all => true, :raise_on_error => false expect(err).to match(/You are trying to install in deployment mode after changing.your Gemfile/m). - and match(/freeze \nby running `bundle config unset deployment`./m) + and match(/freeze \nby running `bundle config set frozen false`./m) end it "should not suggest any command to unfreeze bundler if frozen is set through ENV" do @@ -1451,6 +1451,31 @@ RSpec.describe "bundle update --bundler" do expect(out).to include("Using bundler 2.3.9") end end + + it "prints an error when trying to update bundler in frozen mode" do + system_gems "bundler-2.3.9" + + gemfile <<~G + source "#{file_uri_for(gem_repo2)}" + G + + lockfile <<-L + GEM + remote: #{file_uri_for(gem_repo2)}/ + specs: + + PLATFORMS + ruby + + DEPENDENCIES + + BUNDLED WITH + 2.1.4 + L + + bundle "update --bundler=2.3.9", :env => { "BUNDLE_FROZEN" => "true" } + expect(err).to include("Cannot write a changed lockfile while frozen") + end end # these specs are slow and focus on integration and therefore are not exhaustive. unit specs elsewhere handle that. |