diff options
author | Sutou Kouhei <kou@clear-code.com> | 2020-01-15 12:51:00 +0900 |
---|---|---|
committer | Sutou Kouhei <kou@clear-code.com> | 2020-01-15 12:58:42 +0900 |
commit | 3144c069458bf74070424e675321887e2105e883 (patch) | |
tree | 0eb1722536c989d070f9cce4748cdc67b4a56f97 /spec | |
parent | 1ada1b737ba06af402cd9bb3d9d870761a0f649c (diff) | |
download | bundler-3144c069458bf74070424e675321887e2105e883.tar.gz |
Always add a spec group for all platforms to candidates
Diffstat (limited to 'spec')
-rw-r--r-- | spec/resolver/platform_spec.rb | 19 | ||||
-rw-r--r-- | spec/support/indexes.rb | 4 |
2 files changed, 23 insertions, 0 deletions
diff --git a/spec/resolver/platform_spec.rb b/spec/resolver/platform_spec.rb index 1f39e77117..5949abbecf 100644 --- a/spec/resolver/platform_spec.rb +++ b/spec/resolver/platform_spec.rb @@ -84,6 +84,25 @@ RSpec.describe "Resolving platform craziness" do should_resolve_as %w[foo-1.1.0] end + it "takes the latest ruby gem if the platform specific gem doesn't match the required_ruby_version with multiple platforms" do + @index = build_index do + gem "foo", "1.0.0" + gem "foo", "1.0.0", "x64-mingw32" + gem "foo", "1.1.0" do |s| + s.required_ruby_version = [">= 2.0"] + end + gem "foo", "1.1.0", "x64-mingw32" do |s| + s.required_ruby_version = [">= 2.0", "< 2.4"] + end + gem "Ruby\0", "2.5.1" + end + dep "foo" + dep "Ruby\0", "2.5.1" + platforms "x86_64-linux", "x64-mingw32" + + should_resolve_as %w[foo-1.1.0] + end + describe "with mingw32" do before :each do @index = build_index do diff --git a/spec/support/indexes.rb b/spec/support/indexes.rb index dc6e0bd1e9..7440523fc9 100644 --- a/spec/support/indexes.rb +++ b/spec/support/indexes.rb @@ -26,6 +26,10 @@ module Spec end end source_requirements ||= {} + args[0] ||= [] # base + args[1] ||= Bundler::GemVersionPromoter.new # gem_version_promoter + args[2] ||= [] # additional_base_requirements + args[3] ||= @platforms # platforms Bundler::Resolver.resolve(deps, @index, source_requirements, *args) end |