diff options
| author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2023-06-10 00:19:39 +0200 |
|---|---|---|
| committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-06-15 07:01:25 +0900 |
| commit | e86f4c581b274a3e0bb198b1567cc9aa07d95343 (patch) | |
| tree | 34474353b7f673c7451199999e01aac5b022c1d1 /spec | |
| parent | 23ecaab8dd7e7153ee34cc2cdf43df4448d66e41 (diff) | |
[rubygems/rubygems] Improve frozen mode error message
This error message is also printed when using `bundler/setup` in frozen
model, so we're not necessarily installing any gems when it happens.
This new message play nicer with all situations.
https://github.com/rubygems/rubygems/commit/6874bbacce
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/bundler/commands/inject_spec.rb | 2 | ||||
| -rw-r--r-- | spec/bundler/commands/update_spec.rb | 8 | ||||
| -rw-r--r-- | spec/bundler/install/deploy_spec.rb | 4 | ||||
| -rw-r--r-- | spec/bundler/install/gemfile/gemspec_spec.rb | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/spec/bundler/commands/inject_spec.rb b/spec/bundler/commands/inject_spec.rb index 7d95fe5085..d711fe010d 100644 --- a/spec/bundler/commands/inject_spec.rb +++ b/spec/bundler/commands/inject_spec.rb @@ -109,7 +109,7 @@ Usage: "bundle inject GEM VERSION" gem "rack-obama" G bundle "inject 'rack' '> 0'", :raise_on_error => false - expect(err).to match(/trying to install in frozen mode after changing/) + expect(err).to match(/the lockfile can't be updated because frozen mode is set/) expect(bundled_app_lock.read).not_to match(/rack-obama/) end diff --git a/spec/bundler/commands/update_spec.rb b/spec/bundler/commands/update_spec.rb index b7a86fb99b..df69de44d2 100644 --- a/spec/bundler/commands/update_spec.rb +++ b/spec/bundler/commands/update_spec.rb @@ -658,27 +658,27 @@ RSpec.describe "bundle update" do bundle "update", :all => true, :raise_on_error => false expect(last_command).to be_failure - expect(err).to match(/You are trying to install in frozen mode after changing your Gemfile/) + expect(err).to match(/Bundler is unlocking, but the lockfile can't be updated because frozen mode is set/) expect(err).to match(/freeze by running `bundle config set frozen false`./) end 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 frozen mode after changing your Gemfile/). + expect(err).to match(/Bundler is unlocking, but the lockfile can't be updated because frozen mode is set/). and match(/freeze by running `bundle config set frozen false`./) end 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 frozen mode after changing your Gemfile/). + expect(err).to match(/Bundler is unlocking, but the lockfile can't be updated because frozen mode is set/). and match(/freeze by running `bundle config set frozen false`./) end it "should not suggest any command to unfreeze bundler if frozen is set through ENV" do bundle "update", :all => true, :raise_on_error => false, :env => { "BUNDLE_FROZEN" => "true" } - expect(err).to match(/You are trying to install in frozen mode after changing your Gemfile/) + expect(err).to match(/Bundler is unlocking, but the lockfile can't be updated because frozen mode is set/) expect(err).not_to match(/by running/) end end diff --git a/spec/bundler/install/deploy_spec.rb b/spec/bundler/install/deploy_spec.rb index 799e50c5ab..5dcbf91e33 100644 --- a/spec/bundler/install/deploy_spec.rb +++ b/spec/bundler/install/deploy_spec.rb @@ -473,7 +473,7 @@ RSpec.describe "install in deployment or frozen mode" do run "require 'rack'", :raise_on_error => false expect(err).to include strip_whitespace(<<-E).strip -The dependencies in your gemfile changed +The dependencies in your gemfile changed, but the lockfile can't be updated because frozen mode is set (Bundler::ProductionError) You have added to the Gemfile: * rack (= 1.0.0) @@ -506,7 +506,7 @@ You have deleted from the Gemfile: simulate_new_machine bundle "config set --local deployment true" bundle "install --verbose" - expect(out).not_to include("You are trying to install in frozen mode after changing your Gemfile") + expect(out).not_to include("but the lockfile can't be updated because frozen mode is set") expect(out).not_to include("You have added to the Gemfile") expect(out).not_to include("You have deleted from the Gemfile") expect(out).to include("vendor/cache/foo") diff --git a/spec/bundler/install/gemfile/gemspec_spec.rb b/spec/bundler/install/gemfile/gemspec_spec.rb index 80de05aca9..73f04f071d 100644 --- a/spec/bundler/install/gemfile/gemspec_spec.rb +++ b/spec/bundler/install/gemfile/gemspec_spec.rb @@ -150,7 +150,7 @@ RSpec.describe "bundle install from an existing gemspec" do output = bundle("install", :dir => tmp.join("foo")) expect(output).not_to match(/You have added to the Gemfile/) expect(output).not_to match(/You have deleted from the Gemfile/) - expect(output).not_to match(/install in frozen mode after changing/) + expect(output).not_to match(/the lockfile can't be updated because frozen mode is set/) end it "should match a lockfile without needing to re-resolve" do |
