summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDavid Rodriguez <deivid.rodriguez@riseup.net>2024-03-21 20:59:42 +0100
committergit <svn-admin@ruby-lang.org>2024-04-01 15:03:28 +0000
commite2a1d0b53dddc29b03a535286763fde51d4e089d (patch)
tree0a16519ad4da81f6d62d85ee8986aa2fd45b7c3f /spec
parentf80bb3837c2ba2d46d8906c5f4bdc65f475c76db (diff)
[rubygems/rubygems] Improve error message when strict resolution filters out everything
https://github.com/rubygems/rubygems/commit/1ea44b3749
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/commands/lock_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/bundler/commands/lock_spec.rb b/spec/bundler/commands/lock_spec.rb
index 0f1aeef910..f6793d393b 100644
--- a/spec/bundler/commands/lock_spec.rb
+++ b/spec/bundler/commands/lock_spec.rb
@@ -392,6 +392,22 @@ RSpec.describe "bundle lock" do
expect(the_bundle.locked_gems.specs.map(&:full_name)).to eq(%w[foo-1.5.0 bar-2.1.1 qux-1.1.0].sort)
end
+ it "shows proper error when Gemfile changes forbid patch upgrades, and --patch --strict is given" do
+ # force next minor via Gemfile
+ gemfile <<-G
+ source "#{file_uri_for(gem_repo4)}"
+ gem 'foo', '1.5.0'
+ gem 'qux'
+ G
+
+ bundle "lock --update foo --patch --strict", raise_on_error: false
+
+ expect(err).to include(
+ "foo is locked to 1.4.3, while Gemfile is requesting foo (= 1.5.0). " \
+ "--strict --patch was specified, but there are no patch level upgrades from 1.4.3 satisfying foo (= 1.5.0), so version solving has failed"
+ )
+ end
+
context "pre" do
it "defaults to major" do
bundle "lock --update --pre"