diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-28 00:57:53 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-28 00:57:53 +0000 |
commit | 69934aeb8d7948c4ca590b7092504c41d8bce6ac (patch) | |
tree | 7ea2cdc73f64c5fd001a4e626613ba435a425c0c /test/rubygems/test_gem_remote_fetcher.rb | |
parent | cc00f5bf36a2053e561d968a7e667ff31a9d72d7 (diff) | |
download | ruby-69934aeb8d7948c4ca590b7092504c41d8bce6ac.tar.gz |
rubygems 2.6.7
* lib/rubygems.rb, lib/rubygems/*, test/rubygems/*: Update
rubygems to 2.6.7.
Release note of 2.6.7: https://github.com/rubygems/rubygems/commit/60f35bd1d2359fc30301d2d4cd72bc6833e8d12a
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_remote_fetcher.rb')
-rw-r--r-- | test/rubygems/test_gem_remote_fetcher.rb | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/test/rubygems/test_gem_remote_fetcher.rb b/test/rubygems/test_gem_remote_fetcher.rb index cf1b27d547..ca62a8342e 100644 --- a/test/rubygems/test_gem_remote_fetcher.rb +++ b/test/rubygems/test_gem_remote_fetcher.rb @@ -687,6 +687,23 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg== assert_equal "too many redirects (#{url})", e.message end + def test_fetch_http_redirects_without_location + fetcher = Gem::RemoteFetcher.new nil + @fetcher = fetcher + url = 'http://gems.example.com/redirect' + + def fetcher.request(uri, request_class, last_modified = nil) + res = Net::HTTPMovedPermanently.new nil, 301, nil + res + end + + e = assert_raises Gem::RemoteFetcher::FetchError do + fetcher.fetch_http URI.parse(url) + end + + assert_equal "redirecting but no redirect location was given (#{url})", e.message + end + def test_fetch_http_with_additional_headers ENV["http_proxy"] = @proxy_uri ENV["no_proxy"] = URI::parse(@server_uri).host @@ -1036,4 +1053,3 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg== end end - |