summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/bundler/definition.rb5
-rw-r--r--spec/bundler/install/deploy_spec.rb4
-rw-r--r--spec/bundler/runtime/setup_spec.rb2
3 files changed, 6 insertions, 5 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index f8c73cedf2..287037aa2f 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -539,8 +539,9 @@ module Bundler
reason = resolve_needed? ? change_reason : "some dependencies were deleted from your gemfile"
- msg = String.new
- msg << "#{reason.capitalize.strip}, but the lockfile can't be updated because #{update_refused_reason}"
+ msg = String.new("#{reason.capitalize.strip}, but ")
+ msg << "the lockfile " unless msg.start_with?("Your lockfile")
+ msg << "can't be updated because #{update_refused_reason}"
msg << "\n\nYou have added to the Gemfile:\n" << added.join("\n") if added.any?
msg << "\n\nYou have deleted from the Gemfile:\n" << deleted.join("\n") if deleted.any?
msg << "\n\nYou have changed in the Gemfile:\n" << changed.join("\n") if changed.any?
diff --git a/spec/bundler/install/deploy_spec.rb b/spec/bundler/install/deploy_spec.rb
index bba49aad0a..7db12c0d0b 100644
--- a/spec/bundler/install/deploy_spec.rb
+++ b/spec/bundler/install/deploy_spec.rb
@@ -321,7 +321,7 @@ RSpec.describe "install in deployment or frozen mode" do
L
bundle :install, env: { "BUNDLE_FROZEN" => "true" }, raise_on_error: false, artifice: "compact_index"
- expect(err).to include("Your lockfile is missing \"bar\", but the lockfile can't be updated because frozen mode is set")
+ expect(err).to include("Your lockfile is missing \"bar\", but can't be updated because frozen mode is set")
end
it "explodes if a path gem is missing" do
@@ -550,7 +550,7 @@ RSpec.describe "install in deployment or frozen mode" do
pristine_system_gems :bundler
bundle "config set --local deployment true"
bundle "install --verbose"
- expect(out).not_to include("but the lockfile can't be updated because frozen mode is set")
+ expect(out).not_to include("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/runtime/setup_spec.rb b/spec/bundler/runtime/setup_spec.rb
index 09dad71dbf..fd7b38b05d 100644
--- a/spec/bundler/runtime/setup_spec.rb
+++ b/spec/bundler/runtime/setup_spec.rb
@@ -1683,7 +1683,7 @@ end
RUBY
end
- expect(err).to include("Your lockfile does not include the current platform, but the lockfile can't be updated because file system is read-only")
+ expect(err).to include("Your lockfile does not include the current platform, but can't be updated because file system is read-only")
end
end
end