Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bundler/lib/bundler/fetcher/gem_remote_fetcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ def initialize(*)
super

@pool_size = Bundler.settings.installation_parallelization
ssl_ca_cert = Bundler.settings[:ssl_ca_cert]
@cert_files << ssl_ca_cert if ssl_ca_cert
end

def request(*args)
Expand Down
30 changes: 30 additions & 0 deletions spec/bundler/fetcher/gem_remote_fetcher_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,36 @@
require "bundler/vendored_persistent.rb"

RSpec.describe Bundler::Fetcher::GemRemoteFetcher do
describe "#initialize" do
context "when ssl_ca_cert setting is not set" do
before do
allow(Bundler.settings).to receive(:[]).and_call_original
allow(Bundler.settings).to receive(:[]).with(:ssl_ca_cert).and_return(nil)
end

it "does not append the setting to @cert_files" do
cert_files = subject.instance_variable_get(:@cert_files)
gem_cert_files = Gem::Request.get_cert_files
expect(cert_files).to eq(gem_cert_files)
end
end

context "when ssl_ca_cert setting is set" do
let(:ca_cert_path) { "/path/to/ca_cert" }

before do
allow(Bundler.settings).to receive(:[]).and_call_original
allow(Bundler.settings).to receive(:[]).with(:ssl_ca_cert).and_return(ca_cert_path)
end

it "appends the setting to @cert_files" do
cert_files = subject.instance_variable_get(:@cert_files)
gem_cert_files = Gem::Request.get_cert_files
expect(cert_files).to eq(gem_cert_files + [ca_cert_path])
end
end
end

describe "Parallel download" do
it "download using multiple connections from the pool" do
unless Bundler.rubygems.provides?(">= 4.0.0.dev")
Expand Down
Loading