diff options
author | Tim Moore <tmoore@incrementalism.net> | 2015-01-08 09:34:46 +1100 |
---|---|---|
committer | Tim Moore <tmoore@incrementalism.net> | 2015-01-08 09:34:46 +1100 |
commit | 5b4894af9d9a3a76bbf92970e9d04bd9bf445816 (patch) | |
tree | 15f8006f4b9ba6053d2b336554ff3760743afbc3 | |
parent | e2f0c8f0b879816e1cdbd74e6b66cbeb09013e70 (diff) | |
download | bundler-5b4894af9d9a3a76bbf92970e9d04bd9bf445816.tar.gz |
Failing spec for 403 responses.
-rw-r--r-- | spec/install/gems/dependency_api_spec.rb | 11 | ||||
-rw-r--r-- | spec/support/artifice/endpoint_api_forbidden.rb | 11 |
2 files changed, 22 insertions, 0 deletions
diff --git a/spec/install/gems/dependency_api_spec.rb b/spec/install/gems/dependency_api_spec.rb index 4749a0790a..70739258a0 100644 --- a/spec/install/gems/dependency_api_spec.rb +++ b/spec/install/gems/dependency_api_spec.rb @@ -162,6 +162,17 @@ describe "gemcutter's dependency API" do should_be_installed "rack 1.0.0" end + it "falls back when the API URL returns 403 Forbidden" do + gemfile <<-G + source "#{source_uri}" + gem "rack" + G + + bundle :install, :verbose => true, :artifice => "endpoint_api_forbidden" + expect(out).to include("Fetching source index from #{source_uri}") + should_be_installed "rack 1.0.0" + end + it "handles host redirects" do gemfile <<-G source "#{source_uri}" diff --git a/spec/support/artifice/endpoint_api_forbidden.rb b/spec/support/artifice/endpoint_api_forbidden.rb new file mode 100644 index 0000000000..f9d28c0470 --- /dev/null +++ b/spec/support/artifice/endpoint_api_forbidden.rb @@ -0,0 +1,11 @@ +require File.expand_path("../endpoint", __FILE__) + +Artifice.deactivate + +class EndpointApiForbidden < Endpoint + get "/api/v1/dependencies" do + halt 403 + end +end + +Artifice.activate_with(EndpointApiForbidden) |