diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-01-10 13:53:41 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-01-10 15:53:07 +0900 |
commit | a43f1d90c2b3aed232d5f4ef9dfe226401cf5d81 (patch) | |
tree | dcb61dd3ab8434242b81d54e8e16b4c4d86d5b8c /spec/bundler/resolver/platform_spec.rb | |
parent | 89fb61f9a3276121da2826b93f131e52d6449859 (diff) |
Merge RubyGems and Bundler master
from https://github.com/rubygems/rubygems/commit/0635c1423db5d7c461d53bf0c3329bca75de7609
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/7094
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 |