diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2023-08-25 16:18:01 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-08-28 11:15:34 +0900 |
commit | 80f35d96ae60fdf238ff62982094b4b4dbd13ecf (patch) | |
tree | c95db7a866182d2ecdc6a47b21156d730208aede /spec | |
parent | 2edf9fa23a78da59b5ff0d67a16037aecd38a00f (diff) |
[rubygems/rubygems] Don't check for circular deps on full index sources
https://github.com/rubygems/rubygems/commit/d275cdccb1
Diffstat (limited to 'spec')
-rw-r--r-- | spec/bundler/resolver/basic_spec.rb | 23 | ||||
-rw-r--r-- | spec/bundler/support/indexes.rb | 10 |
2 files changed, 31 insertions, 2 deletions
diff --git a/spec/bundler/resolver/basic_spec.rb b/spec/bundler/resolver/basic_spec.rb index f739f8c02b..151d10c61c 100644 --- a/spec/bundler/resolver/basic_spec.rb +++ b/spec/bundler/resolver/basic_spec.rb @@ -347,4 +347,27 @@ RSpec.describe "Resolving" do should_resolve_as %w[rack-3.0.0 standalone_migrations-1.0.13] end + + it "does not ignore versions that incorrectly depend on themselves when dependency_api is not available" do + @index = build_index do + gem "rack", "3.0.0" + + gem "standalone_migrations", "7.1.0" do + dep "rack", "~> 2.0" + end + + gem "standalone_migrations", "2.0.4" do + dep "standalone_migrations", ">= 2.0.5" + end + + gem "standalone_migrations", "1.0.13" do + dep "rack", ">= 0" + end + end + + dep "rack", "~> 3.0" + dep "standalone_migrations" + + should_resolve_without_dependency_api %w[rack-3.0.0 standalone_migrations-2.0.4] + end end diff --git a/spec/bundler/support/indexes.rb b/spec/bundler/support/indexes.rb index 78372302f1..14f515f870 100644 --- a/spec/bundler/support/indexes.rb +++ b/spec/bundler/support/indexes.rb @@ -14,9 +14,9 @@ module Spec alias_method :platforms, :platform - def resolve(args = []) + def resolve(args = [], dependency_api_available: true) @platforms ||= ["ruby"] - default_source = instance_double("Bundler::Source::Rubygems", :specs => @index, :to_s => "locally install gems") + default_source = instance_double("Bundler::Source::Rubygems", :specs => @index, :to_s => "locally install gems", :dependency_api_available? => dependency_api_available) source_requirements = { :default => default_source } base = args[0] || Bundler::SpecSet.new([]) base.each {|ls| ls.source = default_source } @@ -41,6 +41,12 @@ module Spec expect(got).to eq(specs.sort) end + def should_resolve_without_dependency_api(specs) + got = resolve(:dependency_api_available => false) + got = got.map(&:full_name).sort + expect(got).to eq(specs.sort) + end + def should_resolve_and_include(specs, args = []) got = resolve(args) got = got.map(&:full_name).sort |