diff --git a/lib/bundler/compact_index_client.rb b/lib/bundler/compact_index_client.rb index 692d68e579..a4f5bb1638 100644 --- a/lib/bundler/compact_index_client.rb +++ b/lib/bundler/compact_index_client.rb @@ -75,7 +75,7 @@ module Bundler end def info(name) - Bundler::CompactIndexClient.debug { "info(#{names})" } + Bundler::CompactIndexClient.debug { "info(#{name})" } @parser.info(name) end diff --git a/spec/bundler/install/gems/compact_index_spec.rb b/spec/bundler/install/gems/compact_index_spec.rb index 50add8743b..bd741685d9 100644 --- a/spec/bundler/install/gems/compact_index_spec.rb +++ b/spec/bundler/install/gems/compact_index_spec.rb @@ -15,6 +15,21 @@ RSpec.describe "compact index api" do expect(the_bundle).to include_gems "rack 1.0.0" end + it "has a debug mode" do + gemfile <<-G + source "#{source_uri}" + gem "rack" + G + + bundle :install, artifice: "compact_index", env: { "DEBUG_COMPACT_INDEX" => "true" } + expect(out).to include("Fetching gem metadata from #{source_uri}") + expect(err).to include("[Bundler::CompactIndexClient] available?") + expect(err).to include("[Bundler::CompactIndexClient] fetching versions") + expect(err).to include("[Bundler::CompactIndexClient] info(rack)") + expect(err).to include("[Bundler::CompactIndexClient] fetching info/rack") + expect(the_bundle).to include_gems "rack 1.0.0" + end + it "should URI encode gem names" do gemfile <<-G source "#{source_uri}"