aboutsummaryrefslogtreecommitdiffstats
path: root/test/cgi/test_cgi_tag_helper.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_tag_helper.rb
parent31eb1938832eb3a3a69c7246db151c96b589b877 (diff)
downloadruby-05c29680e515c000552008f725747261ffa6008d.tar.gz
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_tag_helper.rb')
-rw-r--r--test/cgi/test_cgi_tag_helper.rb15
1 files changed, 8 insertions, 7 deletions
diff --git a/test/cgi/test_cgi_tag_helper.rb b/test/cgi/test_cgi_tag_helper.rb
index eb3c20a02e..cc119cb1bc 100644
--- a/test/cgi/test_cgi_tag_helper.rb
+++ b/test/cgi/test_cgi_tag_helper.rb
@@ -1,12 +1,15 @@
require 'test/unit'
require 'cgi'
require 'stringio'
+require_relative 'update_env'
class CGITagHelperTest < Test::Unit::TestCase
+ include UpdateEnv
def setup
+ @environ = {}
#@environ = {
# 'SERVER_PROTOCOL' => 'HTTP/1.1',
# 'REQUEST_METHOD' => 'GET',
@@ -17,16 +20,15 @@ class CGITagHelperTest < Test::Unit::TestCase
def teardown
- @environ.each do |key, val| ENV.delete(key) end
+ ENV.update(@environ)
$stdout = STDOUT
end
def test_cgi_tag_helper_html3
- @environ = {
+ update_env(
'REQUEST_METHOD' => 'GET',
- }
- ENV.update(@environ)
+ )
## html3
cgi = CGI.new('html3')
assert_equal('<A HREF=""></A>',cgi.a)
@@ -337,10 +339,9 @@ class CGITagHelperTest < Test::Unit::TestCase
=end
def test_cgi_tag_helper_html5
- @environ = {
+ update_env(
'REQUEST_METHOD' => 'GET',
- }
- ENV.update(@environ)
+ )
## html5
cgi = CGI.new('html5')
assert_equal('<HEADER></HEADER>',cgi.header)