summaryrefslogtreecommitdiff
path: root/spec/bundler/install/gems/dependency_api_fallback_spec.rb
blob: 7890cbdb993bbca6c2468c71a4dce163e72d287c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

RSpec.describe "gemcutter's dependency API" do
  context "when Gemcutter API takes too long to respond" do
    before do
      bundle "config set timeout 1"
    end

    it "times out and falls back on the modern index" do
      install_gemfile <<-G, artifice: "endpoint_timeout"
        source "https://gem.repo1"
        gem "myrack"
      G

      expect(out).to include("Fetching source index from https://gem.repo1/")
      expect(the_bundle).to include_gems "myrack 1.0.0"
    end
  end
end