Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Add two specs for choosing platform specific gems #6247

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions spec/resolver/platform_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,49 @@
end
end

it "takes the latest ruby gem, even if an older platform specific version is available" do
@index = build_index do
gem "foo", "1.0.0"
gem "foo", "1.0.0", "x64-mingw32"
gem "foo", "1.1.0"
end
dep "foo"
platforms "x64-mingw32"

should_resolve_as %w[foo-1.1.0]
end

it "takes the ruby version if the platform version is incompatible" do
@index = build_index do
gem "bar", "1.0.0"
gem "foo", "1.0.0"
gem "foo", "1.0.0", "x64-mingw32" do
dep "bar", "< 1"
end
end
dep "foo"
platforms "x64-mingw32"

should_resolve_as %w[foo-1.0.0]
end

it "takes the latest ruby gem if the platform specific gem doesn't match the required_ruby_version" do
@index = build_index do
gem "foo", "1.0.0"
gem "foo", "1.0.0", "x64-mingw32"
gem "foo", "1.1.0"
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 "x64-mingw32"

should_resolve_as %w[foo-1.1.0]
end

describe "with mingw32" do
before :each do
@index = build_index do
Expand Down