From 633608ebd4cbdeea562dc4c608495134965a19a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Tue, 24 May 2022 12:18:38 +0200 Subject: [rubygems/rubygems] Fix crash when printing resolution conflicts on metadata requirements https://github.com/rubygems/rubygems/commit/b69e1e9374 --- spec/bundler/install/gems/resolving_spec.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'spec') diff --git a/spec/bundler/install/gems/resolving_spec.rb b/spec/bundler/install/gems/resolving_spec.rb index 469ecd412f..f23d137bc1 100644 --- a/spec/bundler/install/gems/resolving_spec.rb +++ b/spec/bundler/install/gems/resolving_spec.rb @@ -282,6 +282,27 @@ RSpec.describe "bundle install with install-time dependencies" do expect(err).not_to include("That means the author of parallel_tests (3.8.0) has removed it.") end + it "gives a meaningful error on ruby version mismatches between dependencies" do + build_repo4 do + build_gem "requires-old-ruby" do |s| + s.required_ruby_version = "< #{RUBY_VERSION}" + end + end + + build_lib("foo", :path => bundled_app) do |s| + s.required_ruby_version = ">= #{RUBY_VERSION}" + + s.add_dependency "requires-old-ruby" + end + + install_gemfile <<-G, :raise_on_error => false + source "#{file_uri_for(gem_repo4)}" + gemspec + G + + expect(err).to include("Bundler found conflicting requirements for the Ruby\0 version:") + end + it "installs the older version under rate limiting conditions" do build_repo4 do build_gem "rack", "9001.0.0" do |s| -- cgit v1.2.3