ruby-changes:24445
From: kazu <ko1@a...>
Date: Mon, 23 Jul 2012 01:50:58 +0900 (JST)
Subject: [ruby-changes:24445] kazu:r36496 (trunk): fix failures
kazu 2012-07-23 01:50:49 +0900 (Mon, 23 Jul 2012) New Revision: 36496 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=36496 Log: fix failures * test/uri/test_generic.rb (URI#with_env): unset proxy related env variables. [Bug #6774] * test/uri/test_generic.rb (URI#test_find_proxy): fix failures when proxy related env variables already set. [Bug #6774] Modified files: trunk/ChangeLog trunk/test/uri/test_generic.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 36495) +++ ChangeLog (revision 36496) @@ -1,3 +1,11 @@ +Mon Jul 23 01:47:26 2012 Kazuhiro NISHIYAMA <zn@m...> + + * test/uri/test_generic.rb (URI#with_env): unset proxy related env + variables. [Bug #6774] + + * test/uri/test_generic.rb (URI#test_find_proxy): fix failures + when proxy related env variables already set. [Bug #6774] + Sun Jul 22 23:58:48 2012 NARUSE, Yui <naruse@r...> * thread.c (rb_threadptr_execute_interrupts_common): increase Index: test/uri/test_generic.rb =================================================================== --- test/uri/test_generic.rb (revision 36495) +++ test/uri/test_generic.rb (revision 36496) @@ -736,8 +736,10 @@ # 192.0.2.0/24 is TEST-NET. [RFC3330] def test_find_proxy - assert_nil(URI("http://192.0.2.1/").find_proxy) - assert_nil(URI("ftp://192.0.2.1/").find_proxy) + with_env({}) { + assert_nil(URI("http://192.0.2.1/").find_proxy) + assert_nil(URI("ftp://192.0.2.1/").find_proxy) + } with_env('http_proxy'=>'http://127.0.0.1:8080') { assert_equal(URI('http://127.0.0.1:8080'), URI("http://192.0.2.1/").find_proxy) assert_nil(URI("ftp://192.0.2.1/").find_proxy) @@ -771,6 +773,11 @@ end unless RUBY_PLATFORM =~ /mswin|mingw/ def with_env(h) + ['http', 'https', 'ftp'].each do |scheme| + name = "#{scheme}_proxy" + h[name] ||= nil + h["CGI_#{name.upcase}"] ||= nil + end begin old = {} h.each_key {|k| old[k] = ENV[k] } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/