diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2023-08-24 23:08:56 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-08-25 18:34:47 +0900 |
commit | 023b8ddd220f2451b51490ee2e48dedb211e2d1b (patch) | |
tree | b44295481643b20fdde0fd6696e42858b8abfe61 /spec | |
parent | b5d03746359c1e316e0f69742353b2ea74230283 (diff) | |
download | ruby-023b8ddd220f2451b51490ee2e48dedb211e2d1b.tar.gz |
[rubygems/rubygems] Don't use full indexes unnecessarily on legacy Gemfiles
On legacy Gemfiles with multiple remote sources, where all of them
support the compact index API, we were still falling back to full
indexes.
Fixing this also allows to simplifying the code.
https://github.com/rubygems/rubygems/commit/b1357c8e72
Diffstat (limited to 'spec')
-rw-r--r-- | spec/bundler/install/gemfile/sources_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/bundler/install/gemfile/sources_spec.rb b/spec/bundler/install/gemfile/sources_spec.rb index 9095eca03b..1f89f9f0f9 100644 --- a/spec/bundler/install/gemfile/sources_spec.rb +++ b/spec/bundler/install/gemfile/sources_spec.rb @@ -35,6 +35,15 @@ RSpec.describe "bundle install with gems on multiple sources" do expect(the_bundle).to include_gems("rack-obama 1.0.0", "rack 1.0.0", :source => "remote1") end + it "does not use the full index unnecessarily", :bundler => "< 3" do + bundle :install, :artifice => "compact_index", :verbose => true + + expect(out).to include("https://gem.repo1/versions") + expect(out).to include("https://gem.repo3/versions") + expect(out).not_to include("https://gem.repo1/quick/Marshal.4.8/") + expect(out).not_to include("https://gem.repo3/quick/Marshal.4.8/") + end + it "fails", :bundler => "3" do bundle :install, :artifice => "compact_index", :raise_on_error => false expect(err).to include("Each source after the first must include a block") |