summaryrefslogtreecommitdiff
path: root/test/net/http/test_http.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/net/http/test_http.rb')
-rw-r--r--test/net/http/test_http.rb32
1 files changed, 16 insertions, 16 deletions
diff --git a/test/net/http/test_http.rb b/test/net/http/test_http.rb
index e9471273f4..f0f1bc2d8f 100644
--- a/test/net/http/test_http.rb
+++ b/test/net/http/test_http.rb
@@ -126,10 +126,10 @@ class TestNetHTTP < Test::Unit::TestCase
def test_proxy_address_no_proxy
TestNetHTTPUtils.clean_http_proxy_env do
- http = Net::HTTP.new 'hostname.example', nil, 'proxy.example', nil, nil, nil, 'example'
+ http = Net::HTTP.new 'hostname.example', nil, 'proxy.com', nil, nil, nil, 'example'
assert_nil http.proxy_address
- http = Net::HTTP.new '10.224.1.1', nil, 'proxy.example', nil, nil, nil, 'example,10.224.0.0/22'
+ http = Net::HTTP.new '10.224.1.1', nil, 'proxy.com', nil, nil, nil, 'example,10.224.0.0/22'
assert_nil http.proxy_address
end
end
@@ -178,13 +178,8 @@ class TestNetHTTP < Test::Unit::TestCase
http = Net::HTTP.new 'hostname.example'
assert_equal true, http.proxy?
- if Net::HTTP::ENVIRONMENT_VARIABLE_IS_MULTIUSER_SAFE
- assert_equal 'foo', http.proxy_user
- assert_equal 'bar', http.proxy_pass
- else
- assert_nil http.proxy_user
- assert_nil http.proxy_pass
- end
+ assert_equal 'foo', http.proxy_user
+ assert_equal 'bar', http.proxy_pass
end
end
@@ -195,13 +190,8 @@ class TestNetHTTP < Test::Unit::TestCase
http = Net::HTTP.new 'hostname.example'
assert_equal true, http.proxy?
- if Net::HTTP::ENVIRONMENT_VARIABLE_IS_MULTIUSER_SAFE
- assert_equal "Y\\X", http.proxy_user
- assert_equal "R%S] ?X", http.proxy_pass
- else
- assert_nil http.proxy_user
- assert_nil http.proxy_pass
- end
+ assert_equal "Y\\X", http.proxy_user
+ assert_equal "R%S] ?X", http.proxy_pass
end
end
@@ -1244,6 +1234,16 @@ class TestNetHTTPKeepAlive < Test::Unit::TestCase
}
end
+ def test_http_retry_failed_with_block
+ start {|http|
+ http.max_retries = 10
+ called = 0
+ assert_raise(Errno::ECONNRESET){ http.get('/'){called += 1; raise Errno::ECONNRESET} }
+ assert_equal 1, called
+ }
+ @log_tester = nil
+ end
+
def test_keep_alive_server_close
def @server.run(sock)
sock.close