summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThe Bundler Bot <bot@bundler.io>2018-04-07 05:59:06 +0000
committerThe Bundler Bot <bot@bundler.io>2018-04-07 05:59:06 +0000
commit31b4b1e9ba2411b2543c14153416e1ecd2ddd15e (patch)
tree19cda405d7a84bc107e2c82736ce4dbc07b08088
parent257fb54da0003c3a67f6e7b3b5a242a4ba9c45cb (diff)
parentcded07e1bb75c8df1838f010f7de0072a17b6236 (diff)
downloadbundler-31b4b1e9ba2411b2543c14153416e1ecd2ddd15e.tar.gz
Auto merge of #6478 - bundler:segiddins/fix-tests-against-rg-master, r=segiddins
Fix specs against RubyGems master Thanks so much for the contribution! To make reviewing this PR a bit easier, please fill out answers to the following questions. ### What was the end-user problem that led to this PR? The problem was the specs on master are broken running against RubyGems master ### What was your diagnosis of the problem? My diagnosis was This was broken by RubyGems changing how requirements are sorted. ### What is your fix for the problem, implemented in this PR? My fix uses `Gem::Requirement` to get the same sorting rubygems has ### Why did you choose this fix out of the possible options? I chose this fix because the sorting is different between rubygems versions
-rw-r--r--spec/commands/add_spec.rb5
-rw-r--r--spec/install/gems/resolving_spec.rb5
2 files changed, 6 insertions, 4 deletions
diff --git a/spec/commands/add_spec.rb b/spec/commands/add_spec.rb
index 7916db960a..d1f2050aa0 100644
--- a/spec/commands/add_spec.rb
+++ b/spec/commands/add_spec.rb
@@ -51,8 +51,9 @@ RSpec.describe "bundle add" do
end
it "adds multiple version constraints when specified" do
- bundle "add 'foo' --version='< 3.0, > 1.1'"
- expect(bundled_app("Gemfile").read).to match(/gem "foo", "< 3.0", "> 1.1"/)
+ requirements = ["< 3.0", "> 1.0"]
+ bundle "add 'foo' --version='#{requirements.join(", ")}'"
+ expect(bundled_app("Gemfile").read).to match(/gem "foo", #{Gem::Requirement.new(requirements).as_list.map(&:dump).join(', ')}/)
expect(the_bundle).to include_gems "foo 2.0"
end
end
diff --git a/spec/install/gems/resolving_spec.rb b/spec/install/gems/resolving_spec.rb
index 2925542d86..e58f32836c 100644
--- a/spec/install/gems/resolving_spec.rb
+++ b/spec/install/gems/resolving_spec.rb
@@ -166,8 +166,9 @@ RSpec.describe "bundle install with install-time dependencies" do
end
describe "with a compound requirement" do
- let(:ruby_requirement) { %("< 5000", "> 0.1") }
- let(:error_message_requirement) { "< 5000, > 0.1" }
+ let(:reqs) { ["> 0.1", "< 5000"] }
+ let(:ruby_requirement) { reqs.map(&:dump).join(", ") }
+ let(:error_message_requirement) { Gem::Requirement.new(reqs).to_s }
it_behaves_like "ruby version conflicts"
end