summaryrefslogtreecommitdiff
path: root/test/cgi
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-14 06:52:41 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-14 06:52:41 +0000
commitb3a4461df2c78b4828cf344789b80e3c3ebedd14 (patch)
tree6d1016d68392f7efa9f1bb98794e4a3e7fe879b8 /test/cgi
parent9933a6019f8e867a546723e983e0a50593d35cbd (diff)
Suppress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/cgi')
-rw-r--r--test/cgi/test_cgi_header.rb2
-rw-r--r--test/cgi/test_cgi_modruby.rb3
-rw-r--r--test/cgi/test_cgi_multipart.rb8
-rw-r--r--test/cgi/test_cgi_session.rb2
4 files changed, 8 insertions, 7 deletions
diff --git a/test/cgi/test_cgi_header.rb b/test/cgi/test_cgi_header.rb
index c9d939bd49..4d458b1a71 100644
--- a/test/cgi/test_cgi_header.rb
+++ b/test/cgi/test_cgi_header.rb
@@ -77,7 +77,7 @@ class CGIHeaderTest < Test::Unit::TestCase
else
expected = NoMethodError # for Ruby1.8
end
- ex = assert_raise(expected) do
+ assert_raise(expected) do
cgi.header(nil)
end
end
diff --git a/test/cgi/test_cgi_modruby.rb b/test/cgi/test_cgi_modruby.rb
index 4eb02fac56..b41b9bd007 100644
--- a/test/cgi/test_cgi_modruby.rb
+++ b/test/cgi/test_cgi_modruby.rb
@@ -71,7 +71,7 @@ class CGIModrubyTest < Test::Unit::TestCase
'status' => '200 OK',
'location' => 'http://www.example.com/',
}
- actual = cgi.header(options)
+ cgi.header(options)
assert_equal('200 OK', req.status_line) # should be '302 Found' ?
assert_equal(302, req.status)
assert_equal('http://www.example.com/', req.headers_out['location'])
@@ -113,6 +113,7 @@ class Apache #:nodoc:
def hash.add(name, value)
(self[name] ||= []) << value
end
+ @http_header = nil
@headers_out = hash
@status_line = nil
@status = nil
diff --git a/test/cgi/test_cgi_multipart.rb b/test/cgi/test_cgi_multipart.rb
index b51bb7fe2c..e39003d7c3 100644
--- a/test/cgi/test_cgi_multipart.rb
+++ b/test/cgi/test_cgi_multipart.rb
@@ -119,7 +119,7 @@ class CGIMultipartTest < Test::Unit::TestCase
def _prepare(data)
## create multipart input
- multipart = MultiPart.new(@boundary)
+ multipart = MultiPart.new(defined?(@boundary) ? @boundary : nil)
data.each do |hash|
multipart.append(hash[:name], hash[:value], hash[:filename])
end
@@ -141,7 +141,7 @@ class CGIMultipartTest < Test::Unit::TestCase
def _test_multipart
caller(0).find {|s| s =~ /in `test_(.*?)'/ }
- testname = $1
+ #testname = $1
#$stderr.puts "*** debug: testname=#{testname.inspect}"
_prepare(@data)
cgi = RUBY_VERSION>="1.9" ? CGI.new(:accept_charset=>"UTF-8") : CGI.new
@@ -270,7 +270,7 @@ class CGIMultipartTest < Test::Unit::TestCase
input2
end
ex = assert_raise(EOFError) do
- cgi = RUBY_VERSION>="1.9" ? CGI.new(:accept_charset=>"UTF-8") : CGI.new
+ RUBY_VERSION>="1.9" ? CGI.new(:accept_charset=>"UTF-8") : CGI.new
end
assert_equal("bad content body", ex.message)
#
@@ -281,7 +281,7 @@ class CGIMultipartTest < Test::Unit::TestCase
input2
end
ex = assert_raise(EOFError) do
- cgi = RUBY_VERSION>="1.9" ? CGI.new(:accept_charset=>"UTF-8") : CGI.new
+ RUBY_VERSION>="1.9" ? CGI.new(:accept_charset=>"UTF-8") : CGI.new
end
assert_equal("bad content body", ex.message)
end
diff --git a/test/cgi/test_cgi_session.rb b/test/cgi/test_cgi_session.rb
index 7fa7ad7acd..8bd51776ff 100644
--- a/test/cgi/test_cgi_session.rb
+++ b/test/cgi/test_cgi_session.rb
@@ -110,7 +110,7 @@ class CGISessionTest < Test::Unit::TestCase
assert_equal(value1,session["key1"])
assert_equal(value2,session["key2"])
assert_equal("foo",session.session_id)
- session_id=session.session_id
+ #session_id=session.session_id
session.close
$stdout = StringIO.new
cgi.out{""}