summaryrefslogtreecommitdiff
path: root/spec/install
diff options
context:
space:
mode:
authorBundlerbot <bot@bundler.io>2020-01-17 10:07:58 +0000
committerBundlerbot <bot@bundler.io>2020-01-17 10:07:58 +0000
commitdfb128fc09e5239c3b226d4f818cd1484ae29145 (patch)
treeeec76f5954d7fefb59ef7840fb2807cbc28a7ca5 /spec/install
parentd852b30b66165dbb88682f72a8929568af7e7c57 (diff)
parent0629cb41dd2b780cfb88971dabe06b06d1d77e0a (diff)
downloadbundler-dfb128fc09e5239c3b226d4f818cd1484ae29145.tar.gz
Merge #7578
7578: Don't ignore resolved platform information r=deivid-rodriguez a=kou This is a follow-up change of #7522. ### What was the end-user problem that led to this PR? The problem was installing wrong platform gem even when resolver resolves the correct platform gem. See also: * https://github.com/rubygems/bundler/pull/7522#issuecomment-574628275 * https://github.com/rubygems/bundler/pull/7522#issuecomment-574882536 ### What was your diagnosis of the problem? My diagnosis was `Bundler::LazySpecification#__materialize__` doesn't care about the resolved platform information. ### What is your fix for the problem, implemented in this PR? My fix cares about the resolved platform information. ### Why did you choose this fix out of the possible options? I chose this fix because we should respect the resolved platform information to install correct gem. Co-authored-by: Sutou Kouhei <kou@clear-code.com>
Diffstat (limited to 'spec/install')
-rw-r--r--spec/install/gems/resolving_spec.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/install/gems/resolving_spec.rb b/spec/install/gems/resolving_spec.rb
index 547d13134f..fc2936b28c 100644
--- a/spec/install/gems/resolving_spec.rb
+++ b/spec/install/gems/resolving_spec.rb
@@ -143,6 +143,31 @@ RSpec.describe "bundle install with install-time dependencies" do
expect(out).to_not include("rack-9001.0.0 requires ruby version > 9000")
expect(the_bundle).to include_gems("rack 1.2")
end
+
+ it "installs the older not platform specific version" do
+ build_repo4 do
+ build_gem "rack", "9001.0.0" do |s|
+ s.required_ruby_version = "> 9000"
+ end
+ build_gem "rack", "1.2" do |s|
+ s.platform = mingw
+ s.required_ruby_version = "> 9000"
+ end
+ build_gem "rack", "1.2"
+ end
+
+ simulate_platform mingw do
+ install_gemfile <<-G, :artifice => "compact_index", :env => { "BUNDLER_SPEC_GEM_REPO" => gem_repo4.to_s }
+ ruby "#{RUBY_VERSION}"
+ source "http://localgemserver.test/"
+ gem 'rack'
+ G
+ end
+
+ expect(out).to_not include("rack-9001.0.0 requires ruby version > 9000")
+ expect(out).to_not include("rack-1.2-#{Bundler.local_platform} requires ruby version > 9000")
+ expect(the_bundle).to include_gems("rack 1.2")
+ end
end
context "allows no gems" do