summaryrefslogtreecommitdiff
path: root/test/net/http
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2020-09-24 19:39:51 +0900
committerYusuke Endoh <mame@ruby-lang.org>2020-09-24 19:39:51 +0900
commit0c611d7f4fce67c64bee4815f263c55ef15561c4 (patch)
treeff0be0c853bbdbea31ee669319bff93731b2be05 /test/net/http
parent1917afa34bca55ba1ea578234132b7e4479ea3c9 (diff)
test/net/http/test_https.rb: The test logic was buggy
The expected certs must be `[CA_CERT, SERVER_CERT]` before 1.1.1g and `[SERVER_CERT]` after 1.1.1h.
Diffstat (limited to 'test/net/http')
-rw-r--r--test/net/http/test_https.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/net/http/test_https.rb b/test/net/http/test_https.rb
index 1b8841ad11..e9aee15bd3 100644
--- a/test/net/http/test_https.rb
+++ b/test/net/http/test_https.rb
@@ -45,8 +45,8 @@ class TestNetHTTPS < Test::Unit::TestCase
assert_equal($test_net_http_data, res.body)
}
# TODO: OpenSSL 1.1.1h seems to yield only SERVER_CERT; need to check the incompatibility
- certs.each do |cert|
- assert_include([SERVER_CERT.to_der, CA_CERT.to_der], cert.to_der)
+ certs.zip([CA_CERT, SERVER_CERT][-certs.size..]) do |actual, expected|
+ assert_equal(expected.to_der, actual.to_der)
end
rescue SystemCallError
skip $!
@@ -66,8 +66,8 @@ class TestNetHTTPS < Test::Unit::TestCase
assert_equal($test_net_http_data, res.body)
}
# TODO: OpenSSL 1.1.1h seems to yield only SERVER_CERT; need to check the incompatibility
- certs.each do |cert|
- assert_include([SERVER_CERT.to_der, CA_CERT.to_der], cert.to_der)
+ certs.zip([CA_CERT, SERVER_CERT][-certs.size..]) do |actual, expected|
+ assert_equal(expected.to_der, actual.to_der)
end
end