From e453cc71a88e01effc9de6971acc1f446f22495f Mon Sep 17 00:00:00 2001 From: shirosaki Date: Sat, 29 Sep 2012 11:19:06 +0000 Subject: [PATCH] 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 --- ChangeLog | 8 ++++++++ test/net/http/test_http.rb | 26 +++++++++++++++----------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index b6b90a2f47..b1728476a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Sat Sep 29 19:41:33 2012 Hiroshi Shirosaki + + * 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 * test/drb/drbtest.rb (DRbCore#teardown): diff --git a/test/net/http/test_http.rb b/test/net/http/test_http.rb index fc7bfa9806..6a35ca29f1 100644 --- a/test/net/http/test_http.rb +++ b/test/net/http/test_http.rb @@ -88,11 +88,13 @@ class TestNetHTTP < Test::Unit::TestCase end def test_proxy_address - http = Net::HTTP.new 'example', nil, 'proxy.example' - assert_equal 'proxy.example', http.proxy_address + clean_http_proxy_env do + http = Net::HTTP.new 'example', nil, 'proxy.example' + assert_equal 'proxy.example', http.proxy_address - http = Net::HTTP.new 'example', nil - assert_equal nil, http.proxy_address + http = Net::HTTP.new 'example', nil + assert_equal nil, http.proxy_address + end end def test_proxy_address_ENV @@ -137,13 +139,15 @@ class TestNetHTTP < Test::Unit::TestCase end def test_proxy_port - http = Net::HTTP.new 'exmaple', nil, 'proxy.example' - assert_equal 'proxy.example', http.proxy_address - assert_equal 80, http.proxy_port - http = Net::HTTP.new 'exmaple', nil, 'proxy.example', 8000 - assert_equal 8000, http.proxy_port - http = Net::HTTP.new 'exmaple', nil - assert_equal nil, http.proxy_port + clean_http_proxy_env do + http = Net::HTTP.new 'exmaple', nil, 'proxy.example' + assert_equal 'proxy.example', http.proxy_address + assert_equal 80, http.proxy_port + http = Net::HTTP.new 'exmaple', nil, 'proxy.example', 8000 + assert_equal 8000, http.proxy_port + http = Net::HTTP.new 'exmaple', nil + assert_equal nil, http.proxy_port + end end def test_proxy_port_ENV