summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2023-06-08 20:31:43 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-06-15 07:01:21 +0900
commite7749c4dea1e580455264b6c4caa03d79524aef4 (patch)
treeb9f7ee2585e7f565e096b5d15336fa7585635c3b
parent90c60e81380bfc8955135bc50f02a2018623ff98 (diff)
[rubygems/rubygems] Remove weird line breaks in the middle of error message
https://github.com/rubygems/rubygems/commit/22b8caf42f
-rw-r--r--lib/bundler/definition.rb9
-rw-r--r--spec/bundler/commands/update_spec.rb14
2 files changed, 11 insertions, 12 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index 3e10b68783..3173359749 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -365,16 +365,15 @@ module Bundler
def ensure_equivalent_gemfile_and_lockfile(explicit_flag = false)
msg = String.new
- msg << "You are trying to install in deployment mode after changing\n" \
- "your Gemfile. Run `bundle install` elsewhere and add the\n" \
- "updated #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} to version control."
+ msg << "You are trying to install in deployment mode after changing your Gemfile.\n" \
+ "Run `bundle install` elsewhere and add the updated #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} to version control.\n"
unless explicit_flag
suggested_command = unless Bundler.settings.locations("frozen").keys.include?(:env)
"bundle config set frozen false"
end
- msg << "\n\nIf this is a development machine, remove the #{Bundler.default_gemfile} " \
- "freeze \nby running `#{suggested_command}`." if suggested_command
+ msg << "If this is a development machine, remove the #{Bundler.default_gemfile} " \
+ "freeze by running `#{suggested_command}`." if suggested_command
end
added = []
diff --git a/spec/bundler/commands/update_spec.rb b/spec/bundler/commands/update_spec.rb
index 7a0d435860..76aa046292 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 deployment mode after changing.your Gemfile/m)
- expect(err).to match(/freeze \nby running `bundle config set frozen false`./m)
+ expect(err).to match(/You are trying to install in deployment mode after changing your Gemfile/)
+ 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 deployment mode after changing.your Gemfile/m).
- and match(/freeze \nby running `bundle config set frozen false`./m)
+ expect(err).to match(/You are trying to install in deployment mode after changing your Gemfile/).
+ 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 deployment mode after changing.your Gemfile/m).
- and match(/freeze \nby running `bundle config set frozen false`./m)
+ expect(err).to match(/You are trying to install in deployment mode after changing your Gemfile/).
+ 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 deployment mode after changing.your Gemfile/m)
+ expect(err).to match(/You are trying to install in deployment mode after changing your Gemfile/)
expect(err).not_to match(/by running/)
end
end