summaryrefslogtreecommitdiff
path: root/test/cgi/test_cgi_modruby.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-12 14:57:33 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-12 14:57:33 +0000
commit05c29680e515c000552008f725747261ffa6008d (patch)
tree4ad6c4c057ec68f3d7b396a8fa55022f45ee274c /test/cgi/test_cgi_modruby.rb
parent31eb1938832eb3a3a69c7246db151c96b589b877 (diff)
fix env leaks
* lib/rubygems/test_case.rb (setup, teardown): fix environment variable change leaks. * test/cgi/update_env.rb: ditto. * test/rake/test_rake_application_options.rb (setup, teardown): ditto. * test/rake/test_rake_file_utils.rb (setup, teardown): ditto. * test/rubygems/test_gem_request.rb (setup): add https_proxy. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/cgi/test_cgi_modruby.rb')
-rw-r--r--test/cgi/test_cgi_modruby.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/cgi/test_cgi_modruby.rb b/test/cgi/test_cgi_modruby.rb
index b0fc442bc9..ed1d519bae 100644
--- a/test/cgi/test_cgi_modruby.rb
+++ b/test/cgi/test_cgi_modruby.rb
@@ -1,17 +1,19 @@
require 'test/unit'
require 'cgi'
+require_relative 'update_env'
class CGIModrubyTest < Test::Unit::TestCase
+ include UpdateEnv
def setup
- @environ = {
+ @environ = {}
+ update_env(
'SERVER_PROTOCOL' => 'HTTP/1.1',
'REQUEST_METHOD' => 'GET',
#'QUERY_STRING' => 'a=foo&b=bar',
- }
- ENV.update(@environ)
+ )
CGI.class_eval { const_set(:MOD_RUBY, true) }
Apache._reset()
#@cgi = CGI.new
@@ -20,7 +22,7 @@ class CGIModrubyTest < Test::Unit::TestCase
def teardown
- @environ.each do |key, val| ENV.delete(key) end
+ ENV.update(@environ)
CGI.class_eval { remove_const(:MOD_RUBY) }
end