use assert_raise
* test/openssl/test_ssl.rb: use assert_raise instead of a deprecated method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b5a5cd605b
commit
33e39a7657
@ -33,7 +33,7 @@ class OpenSSL::TestSSL < OpenSSL::SSLTestCase
|
|||||||
ctx = OpenSSL::SSL::SSLContext.new
|
ctx = OpenSSL::SSL::SSLContext.new
|
||||||
options = ctx.options
|
options = ctx.options
|
||||||
ctx.setup
|
ctx.setup
|
||||||
assert_raises(RuntimeError) do
|
assert_raise(RuntimeError) do
|
||||||
ctx.options = options
|
ctx.options = options
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -707,12 +707,12 @@ class OpenSSL::TestSSL < OpenSSL::SSLTestCase
|
|||||||
s1 = OpenSSL::SSL::SSLSocket.new(sock1, ctx1)
|
s1 = OpenSSL::SSL::SSLSocket.new(sock1, ctx1)
|
||||||
s1.hostname = hostname
|
s1.hostname = hostname
|
||||||
t = Thread.new {
|
t = Thread.new {
|
||||||
assert_raises(OpenSSL::SSL::SSLError) do
|
assert_raise(OpenSSL::SSL::SSLError) do
|
||||||
s1.connect
|
s1.connect
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
assert_raises(ArgumentError) do
|
assert_raise(ArgumentError) do
|
||||||
s2.accept
|
s2.accept
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1029,7 +1029,7 @@ if OpenSSL::OPENSSL_VERSION_NUMBER >= 0x10002000
|
|||||||
ctx_proc = Proc.new { |ctx|
|
ctx_proc = Proc.new { |ctx|
|
||||||
ctx.alpn_select_cb = -> (protocols) { nil }
|
ctx.alpn_select_cb = -> (protocols) { nil }
|
||||||
}
|
}
|
||||||
assert_raises(MiniTest::Assertion) do # minitest/assertion comes from `assert_join_threads`
|
assert_raise(MiniTest::Assertion) do # minitest/assertion comes from `assert_join_threads`
|
||||||
start_server_version(:SSLv23, ctx_proc) { |server, port|
|
start_server_version(:SSLv23, ctx_proc) { |server, port|
|
||||||
ctx = OpenSSL::SSL::SSLContext.new
|
ctx = OpenSSL::SSL::SSLContext.new
|
||||||
ctx.alpn_protocols = ["http/1.1"]
|
ctx.alpn_protocols = ["http/1.1"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user