зеркало из https://github.com/github/ruby.git
* test/cgi/test_cgi_multipart.rb : revert last change.
( deprecated is assert_raises. ) * test/cgi/test_cgi_core.rb : ditto. * test/cgi/test_cgi_header.rb : ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
3c419de10b
Коммит
0f6375be69
|
@ -1,3 +1,10 @@
|
|||
Wed Sep 24 23:39:00 2008 Takeyuki Fujioka <xibbar@ruby-lang.org>
|
||||
|
||||
* test/cgi/test_cgi_multipart.rb : revert last change.
|
||||
( deprecated is assert_raises. )
|
||||
* test/cgi/test_cgi_core.rb : ditto.
|
||||
* test/cgi/test_cgi_header.rb : ditto.
|
||||
|
||||
Wed Sep 24 23:12:49 2008 Takeyuki Fujioka <xibbar@ruby-lang.org>
|
||||
|
||||
* lib/cgi/core.rb (CGI::new, CGI::{accept_charset,accept_charset=}) :
|
||||
|
|
|
@ -122,7 +122,7 @@ class CGICoreTest < Test::Unit::TestCase
|
|||
assert_equal({"str"=>"\xBE\xBE\xB9\xBE".force_encoding("ASCII-8BIT")},hash)
|
||||
|
||||
$stdin.rewind
|
||||
assert_raises(CGI::InvalidEncoding) do
|
||||
assert_raise(CGI::InvalidEncoding) do
|
||||
cgi = CGI.new(:accept_charset=>"UTF-8")
|
||||
end
|
||||
|
||||
|
@ -148,7 +148,7 @@ class CGICoreTest < Test::Unit::TestCase
|
|||
}
|
||||
ENV.update(@environ)
|
||||
cgi = CGI.new
|
||||
refute_nil(cgi.cookies)
|
||||
assert_not_equal(nil,cgi.cookies)
|
||||
[ ['_session_id', ['12345'], ],
|
||||
['name1', ['val1', 'val2'], ],
|
||||
].each do |key, expected|
|
||||
|
@ -169,7 +169,7 @@ class CGICoreTest < Test::Unit::TestCase
|
|||
'CONTENT_LENGTH' => (64 * 1024 * 1024).to_s
|
||||
}
|
||||
ENV.update(@environ)
|
||||
ex = assert_raises(StandardError) do
|
||||
ex = assert_raise(StandardError) do
|
||||
cgi = CGI.new
|
||||
end
|
||||
assert_equal("too large post data.", ex.message)
|
||||
|
@ -323,7 +323,7 @@ class CGICoreTest < Test::Unit::TestCase
|
|||
ENV.update(@environ)
|
||||
## no htmltype
|
||||
cgi = CGI.new
|
||||
assert_raises(NoMethodError) do cgi.doctype end
|
||||
assert_raise(NoMethodError) do cgi.doctype end
|
||||
## html3
|
||||
cgi = CGI.new('html3')
|
||||
expected = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">'
|
||||
|
|
|
@ -76,7 +76,7 @@ class CGIHeaderTest < Test::Unit::TestCase
|
|||
else
|
||||
expected = NoMethodError # for Ruby1.8
|
||||
end
|
||||
ex = assert_raises(expected) do
|
||||
ex = assert_raise(expected) do
|
||||
cgi.header(nil)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -213,7 +213,7 @@ class CGIMultipartTest < Test::Unit::TestCase
|
|||
]
|
||||
original = _set_const(CGI, :MAX_MULTIPART_LENGTH, 2 * 1024)
|
||||
begin
|
||||
ex = assert_raises(StandardError) do
|
||||
ex = assert_raise(StandardError) do
|
||||
_test_multipart()
|
||||
end
|
||||
assert_equal("too large multipart data.", ex.message)
|
||||
|
@ -232,7 +232,7 @@ class CGIMultipartTest < Test::Unit::TestCase
|
|||
500.times { @data << item }
|
||||
#original = _set_const(CGI, :MAX_MULTIPART_COUNT, 128)
|
||||
begin
|
||||
ex = assert_raises(StandardError) do
|
||||
ex = assert_raise(StandardError) do
|
||||
_test_multipart()
|
||||
end
|
||||
assert_equal("too many parameters.", ex.message)
|
||||
|
@ -253,7 +253,7 @@ class CGIMultipartTest < Test::Unit::TestCase
|
|||
#p input2
|
||||
input2
|
||||
end
|
||||
ex = assert_raises(EOFError) do
|
||||
ex = assert_raise(EOFError) do
|
||||
cgi = CGI.new
|
||||
end
|
||||
assert_equal("bad boundary end of body part", ex.message)
|
||||
|
@ -264,7 +264,7 @@ class CGIMultipartTest < Test::Unit::TestCase
|
|||
#p input2
|
||||
input2
|
||||
end
|
||||
ex = assert_raises(EOFError) do
|
||||
ex = assert_raise(EOFError) do
|
||||
cgi = CGI.new
|
||||
end
|
||||
assert_equal("bad content body", ex.message)
|
||||
|
|
Загрузка…
Ссылка в новой задаче