diff options
Diffstat (limited to 'spec/bundler/resolver/platform_spec.rb')
-rw-r--r-- | spec/bundler/resolver/platform_spec.rb | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/spec/bundler/resolver/platform_spec.rb b/spec/bundler/resolver/platform_spec.rb index 2d143fd84a..a710dfcb28 100644 --- a/spec/bundler/resolver/platform_spec.rb +++ b/spec/bundler/resolver/platform_spec.rb @@ -155,21 +155,32 @@ RSpec.describe "Resolving platform craziness" do end 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"] + context "when the platform specific gem doesn't match the required_ruby_version" do + before 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 - gem "Ruby\0", "2.5.1" + dep "Ruby\0", "2.5.1" + platforms "x64-mingw32" end - dep "foo" - dep "Ruby\0", "2.5.1" - platforms "x64-mingw32" - should_resolve_as %w[foo-1.1.0] + it "takes the latest ruby gem" do + dep "foo" + + should_resolve_as %w[foo-1.1.0] + end + + it "takes the latest ruby gem, even if requirement does not match previous versions with the same ruby requirement" do + dep "foo", "1.1.0" + + should_resolve_as %w[foo-1.1.0] + end end it "takes the latest ruby gem with required_ruby_version if the platform specific gem doesn't match the required_ruby_version" do |