summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBundlerbot <bot@bundler.io>2020-02-20 20:17:56 +0000
committerBundlerbot <bot@bundler.io>2020-02-20 20:17:56 +0000
commit447cdd69004239a850fc12225ce2a47e3c473d39 (patch)
tree95daf53a85d98a8abad17a4359bddf0fba98ccbd
parent860f8665f0211d22328a12c9e5ac8dcefbcbe0f0 (diff)
parent61bc8fda26836e270f191f776a0a6d5575626a0c (diff)
downloadbundler-447cdd69004239a850fc12225ce2a47e3c473d39.tar.gz
Merge #7649
7649: Fix resolving specs when run against a dev ruby snapshot r=deivid-rodriguez a=deivid-rodriguez <!-- Thanks so much for the contribution! If you're updating documentation, make sure you run `bin/rake man:build` and squash the result into your changes, so that all documentation formats are updated. To make reviewing this PR a bit easier, please fill out answers to the following questions. --> ### What was the end-user or developer problem that led to this PR? The problem is that in some dev ruby builds, `RUBY_PATCHLEVEL` is `-1`, so the spec crashes because of an ill-formed requirement. See for example https://github.com/rubygems/rubygems/pull/3077/checks?check_run_id=457988784. <!-- Write a clear and complete description of the problem --> ### What is your fix for the problem, implemented in this PR? <!-- Explain the fix being implemented. Include any diagnosis you run to determine the cause of the issue and your conclusions. If you considered other alternatives, explain why you end up choosing the current implementation --> My fix is to change the spec to respect a `RUBY_PATCHLEVEL` equal to `-1`, by reusing code that handles that case. Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
-rw-r--r--spec/install/gems/resolving_spec.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/install/gems/resolving_spec.rb b/spec/install/gems/resolving_spec.rb
index 323b28fdb1..e55e91f126 100644
--- a/spec/install/gems/resolving_spec.rb
+++ b/spec/install/gems/resolving_spec.rb
@@ -233,7 +233,7 @@ RSpec.describe "bundle install with install-time dependencies" do
describe "with a < requirement" do
let(:ruby_requirement) { %("< 5000") }
- let(:error_message_requirement) { Gem::Requirement.new(["< 5000", "= #{RUBY_VERSION}.#{RUBY_PATCHLEVEL}"]).to_s }
+ let(:error_message_requirement) { Gem::Requirement.new(["< 5000", "= #{Bundler::RubyVersion.system.to_gem_version_with_patchlevel}"]).to_s }
it_behaves_like "ruby version conflicts"
end
@@ -241,7 +241,7 @@ RSpec.describe "bundle install with install-time dependencies" do
describe "with a compound requirement" do
let(:reqs) { ["> 0.1", "< 5000"] }
let(:ruby_requirement) { reqs.map(&:dump).join(", ") }
- let(:error_message_requirement) { Gem::Requirement.new(reqs + ["= #{RUBY_VERSION}.#{RUBY_PATCHLEVEL}"]).to_s }
+ let(:error_message_requirement) { Gem::Requirement.new(reqs + ["= #{Bundler::RubyVersion.system.to_gem_version_with_patchlevel}"]).to_s }
it_behaves_like "ruby version conflicts"
end