ruby-changes:40940
From: naruse <ko1@a...>
Date: Thu, 10 Dec 2015 06:54:37 +0900 (JST)
Subject: [ruby-changes:40940] naruse:r53019 (trunk): fix r53013; the environment defines "example" as local hostname
naruse 2015-12-10 06:54:21 +0900 (Thu, 10 Dec 2015) New Revision: 53019 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53019 Log: fix r53013; the environment defines "example" as local hostname Modified files: trunk/test/net/http/test_http.rb Index: test/net/http/test_http.rb =================================================================== --- test/net/http/test_http.rb (revision 53018) +++ test/net/http/test_http.rb (revision 53019) @@ -22,7 +22,7 @@ class TestNetHTTP < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/net/http/test_http.rb#L22 assert_equal 'user', proxy_class.proxy_user assert_equal 'pass', proxy_class.proxy_pass - http = proxy_class.new 'example' + http = proxy_class.new 'hostname.example' refute http.proxy_from_env? @@ -52,14 +52,14 @@ class TestNetHTTP < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/net/http/test_http.rb#L52 refute_equal 8000, proxy_class.proxy_port - http = proxy_class.new 'example' + http = proxy_class.new 'hostname.example' assert http.proxy_from_env? end end def test_edit_path - http = Net::HTTP.new 'example', nil, nil + http = Net::HTTP.new 'hostname.example', nil, nil edited = http.send :edit_path, '/path' @@ -73,11 +73,11 @@ class TestNetHTTP < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/net/http/test_http.rb#L73 end def test_edit_path_proxy - http = Net::HTTP.new 'example', nil, 'proxy.example' + http = Net::HTTP.new 'hostname.example', nil, 'proxy.example' edited = http.send :edit_path, '/path' - assert_equal 'http://example/path', edited + assert_equal 'http://hostname.example/path', edited http.use_ssl = true @@ -88,10 +88,10 @@ class TestNetHTTP < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/net/http/test_http.rb#L88 def test_proxy_address clean_http_proxy_env do - http = Net::HTTP.new 'example', nil, 'proxy.example' + http = Net::HTTP.new 'hostname.example', nil, 'proxy.example' assert_equal 'proxy.example', http.proxy_address - http = Net::HTTP.new 'example', nil + http = Net::HTTP.new 'hostname.example', nil assert_equal nil, http.proxy_address end end @@ -101,7 +101,7 @@ class TestNetHTTP < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/net/http/test_http.rb#L101 ENV['http_proxy'] = 'http://proxy.example:8000' assert_equal false, Net::HTTP.proxy_class? - http = Net::HTTP.new 'example' + http = Net::HTTP.new 'hostname.example' assert_equal true, http.proxy_from_env? end @@ -111,7 +111,7 @@ class TestNetHTTP < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/net/http/test_http.rb#L111 clean_http_proxy_env do ENV['http_proxy'] = 'http://proxy.example:8000' - http = Net::HTTP.new 'example' + http = Net::HTTP.new 'hostname.example' assert_equal 'proxy.example', http.proxy_address end @@ -119,7 +119,7 @@ class TestNetHTTP < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/net/http/test_http.rb#L119 def test_proxy_eh_no_proxy clean_http_proxy_env do - assert_equal false, Net::HTTP.new('example', nil, nil).proxy? + assert_equal false, Net::HTTP.new('hostname.example', nil, nil).proxy? end end @@ -127,7 +127,7 @@ class TestNetHTTP < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/net/http/test_http.rb#L127 clean_http_proxy_env do ENV['http_proxy'] = 'http://proxy.example:8000' - http = Net::HTTP.new 'example' + http = Net::HTTP.new 'hostname.example' assert_equal true, http.proxy? end @@ -135,16 +135,16 @@ class TestNetHTTP < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/net/http/test_http.rb#L135 def test_proxy_eh_ENV_none_set clean_http_proxy_env do - assert_equal false, Net::HTTP.new('example').proxy? + assert_equal false, Net::HTTP.new('hostname.example').proxy? end end def test_proxy_eh_ENV_no_proxy clean_http_proxy_env do ENV['http_proxy'] = 'http://proxy.example:8000' - ENV['no_proxy'] = 'example' + ENV['no_proxy'] = 'hostname.example' - assert_equal false, Net::HTTP.new('example').proxy? + assert_equal false, Net::HTTP.new('hostname.example').proxy? end end @@ -164,7 +164,7 @@ class TestNetHTTP < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/net/http/test_http.rb#L164 clean_http_proxy_env do ENV['http_proxy'] = 'http://proxy.example:8000' - http = Net::HTTP.new 'example' + http = Net::HTTP.new 'hostname.example' assert_equal 8000, http.proxy_port end @@ -174,7 +174,7 @@ class TestNetHTTP < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/net/http/test_http.rb#L174 clean_http_proxy_env do ENV['http_proxy'] = 'http://proxy.example:8000' - http = Net::HTTP.newobj 'example' + http = Net::HTTP.newobj 'hostname.example' assert_equal false, http.proxy? end @@ -554,7 +554,7 @@ module TestNetHTTP_version_1_2_methods https://github.com/ruby/ruby/blob/trunk/test/net/http/test_http.rb#L554 end def _test_request__path(http) - uri = URI 'https://example/' + uri = URI 'https://hostname.example/' req = Net::HTTP::Get.new('/') res = http.request(req) @@ -570,7 +570,7 @@ module TestNetHTTP_version_1_2_methods https://github.com/ruby/ruby/blob/trunk/test/net/http/test_http.rb#L570 end def _test_request__uri(http) - uri = URI 'https://example/' + uri = URI 'https://hostname.example/' req = Net::HTTP::Get.new(uri) res = http.request(req) @@ -589,13 +589,13 @@ module TestNetHTTP_version_1_2_methods https://github.com/ruby/ruby/blob/trunk/test/net/http/test_http.rb#L589 uri = URI 'http://other.example/' req = Net::HTTP::Get.new(uri) - req['host'] = 'example' + req['host'] = 'hostname.example' res = http.request(req) assert_kind_of URI::Generic, req.uri - assert_equal URI("http://example:#{http.port}"), res.uri + assert_equal URI("http://hostname.example:#{http.port}"), res.uri end def test_send_request -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/