mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test_http.rb: clear environment variables
* test/net/http/test_http.rb (TestNetHTTP#test_proxy_address): clear environment variables. If http_proxy environment variable was set, the test failed. * test/net/http/test_http.rb (TestNetHTTP#test_proxy_port): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d0df0547c6
commit
e453cc71a8
2 changed files with 23 additions and 11 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
Sat Sep 29 19:41:33 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
|
||||||
|
|
||||||
|
* test/net/http/test_http.rb (TestNetHTTP#test_proxy_address):
|
||||||
|
clear environment variables. If http_proxy environment variable was
|
||||||
|
set, the test failed.
|
||||||
|
|
||||||
|
* test/net/http/test_http.rb (TestNetHTTP#test_proxy_port): ditto.
|
||||||
|
|
||||||
Sat Sep 29 19:41:11 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
|
Sat Sep 29 19:41:11 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
|
||||||
|
|
||||||
* test/drb/drbtest.rb (DRbCore#teardown):
|
* test/drb/drbtest.rb (DRbCore#teardown):
|
||||||
|
|
|
@ -88,11 +88,13 @@ class TestNetHTTP < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_proxy_address
|
def test_proxy_address
|
||||||
http = Net::HTTP.new 'example', nil, 'proxy.example'
|
clean_http_proxy_env do
|
||||||
assert_equal 'proxy.example', http.proxy_address
|
http = Net::HTTP.new 'example', nil, 'proxy.example'
|
||||||
|
assert_equal 'proxy.example', http.proxy_address
|
||||||
|
|
||||||
http = Net::HTTP.new 'example', nil
|
http = Net::HTTP.new 'example', nil
|
||||||
assert_equal nil, http.proxy_address
|
assert_equal nil, http.proxy_address
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_proxy_address_ENV
|
def test_proxy_address_ENV
|
||||||
|
@ -137,13 +139,15 @@ class TestNetHTTP < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_proxy_port
|
def test_proxy_port
|
||||||
http = Net::HTTP.new 'exmaple', nil, 'proxy.example'
|
clean_http_proxy_env do
|
||||||
assert_equal 'proxy.example', http.proxy_address
|
http = Net::HTTP.new 'exmaple', nil, 'proxy.example'
|
||||||
assert_equal 80, http.proxy_port
|
assert_equal 'proxy.example', http.proxy_address
|
||||||
http = Net::HTTP.new 'exmaple', nil, 'proxy.example', 8000
|
assert_equal 80, http.proxy_port
|
||||||
assert_equal 8000, http.proxy_port
|
http = Net::HTTP.new 'exmaple', nil, 'proxy.example', 8000
|
||||||
http = Net::HTTP.new 'exmaple', nil
|
assert_equal 8000, http.proxy_port
|
||||||
assert_equal nil, http.proxy_port
|
http = Net::HTTP.new 'exmaple', nil
|
||||||
|
assert_equal nil, http.proxy_port
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_proxy_port_ENV
|
def test_proxy_port_ENV
|
||||||
|
|
Loading…
Reference in a new issue