Skip to content

Commit 71ba189

Browse files
mamehsbt
authored andcommitted
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.
1 parent 8632ba9 commit 71ba189

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/net/http/test_https.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ def test_get
4545
assert_equal($test_net_http_data, res.body)
4646
}
4747
# TODO: OpenSSL 1.1.1h seems to yield only SERVER_CERT; need to check the incompatibility
48-
certs.each do |cert|
49-
assert_include([SERVER_CERT.to_der, CA_CERT.to_der], cert.to_der)
48+
certs.zip([CA_CERT, SERVER_CERT][-certs.size..]) do |actual, expected|
49+
assert_equal(expected.to_der, actual.to_der)
5050
end
5151
rescue SystemCallError
5252
skip $!
@@ -66,8 +66,8 @@ def test_get_SNI
6666
assert_equal($test_net_http_data, res.body)
6767
}
6868
# TODO: OpenSSL 1.1.1h seems to yield only SERVER_CERT; need to check the incompatibility
69-
certs.each do |cert|
70-
assert_include([SERVER_CERT.to_der, CA_CERT.to_der], cert.to_der)
69+
certs.zip([CA_CERT, SERVER_CERT][-certs.size..]) do |actual, expected|
70+
assert_equal(expected.to_der, actual.to_der)
7171
end
7272
end
7373

0 commit comments

Comments
 (0)