[前][次][番号順一覧][スレッド一覧]

ruby-changes:25004

From: shirosaki <ko1@a...>
Date: Sat, 29 Sep 2012 20:19:34 +0900 (JST)
Subject: [ruby-changes:25004] shirosaki:r37056 (trunk): test_http.rb: clear environment variables

shirosaki	2012-09-29 20:19:06 +0900 (Sat, 29 Sep 2012)

  New Revision: 37056

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=37056

  Log:
    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.

  Modified files:
    trunk/ChangeLog
    trunk/test/net/http/test_http.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 37055)
+++ ChangeLog	(revision 37056)
@@ -1,3 +1,11 @@
+Sat Sep 29 19:41:33 2012  Hiroshi Shirosaki  <h.shirosaki@g...>
+
+	* 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@g...>
 
 	* test/drb/drbtest.rb (DRbCore#teardown):
Index: test/net/http/test_http.rb
===================================================================
--- test/net/http/test_http.rb	(revision 37055)
+++ test/net/http/test_http.rb	(revision 37056)
@@ -88,11 +88,13 @@
   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 @@
   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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]