summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_remote_fetcher.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-08 22:46:43 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-08 22:46:43 +0000
commit59991b6ac517fcaa4f8122a1da6552a66892449e (patch)
tree1379ec1662eca3c5a08e02e221c4b4045d08f0a7 /test/rubygems/test_gem_remote_fetcher.rb
parent230b8d533e67b82654975fdc581693967ff06daf (diff)
* lib/rubygems: Update to RubyGems HEAD(fe61e4c112).
this version contains new feature that warn invalid SPDX license identifiers. https://github.com/rubygems/rubygems/pull/1249 and #1032, #1023, #1332, #1328, #1306, #1321, #1324 * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_remote_fetcher.rb')
-rw-r--r--test/rubygems/test_gem_remote_fetcher.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_remote_fetcher.rb b/test/rubygems/test_gem_remote_fetcher.rb
index 826b20d040..bb752d1ef7 100644
--- a/test/rubygems/test_gem_remote_fetcher.rb
+++ b/test/rubygems/test_gem_remote_fetcher.rb
@@ -252,6 +252,31 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
dns.verify
end
+ def test_api_endpoint_timeout_warning
+ uri = URI.parse "http://gems.example.com/foo"
+
+ dns = MiniTest::Mock.new
+ def dns.getresource arg, *rest
+ raise Resolv::ResolvError.new('timeout!')
+ end
+
+ fetch = Gem::RemoteFetcher.new nil, dns
+ begin
+ old_verbose, Gem.configuration.verbose = Gem.configuration.verbose, 1
+ endpoint = use_ui @ui do
+ fetch.api_endpoint(uri)
+ end
+ ensure
+ Gem.configuration.verbose = old_verbose
+ end
+
+ assert_equal uri, endpoint
+
+ assert_equal "Getting SRV record failed: timeout!\n", @ui.output
+
+ dns.verify
+ end
+
def test_cache_update_path
uri = URI 'http://example/file'
path = File.join @tempdir, 'file'
@@ -1010,3 +1035,4 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
end
end
+