Skip to content

Commit 2d9f0c4

Browse files
committed
Set VERBOSE to true in test_sni.
The test no longer relies on the value of $VERBOSE being set by outside environment. The test test_sni in test_https.rb file checks stderr output for information about primes being generated. Since commit 6cb9bf6 the output is only written if $VERBOSE is true. This happens when `--verbose` is provided to the Ruby run arguments, or when the tests are ran via `rake`.
1 parent cde6dd4 commit 2d9f0c4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/webrick/test_https.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ def test_sni
5454
# catch stderr in create_self_signed_cert
5555
stderr_buffer = StringIO.new
5656
old_stderr, $stderr = $stderr, stderr_buffer
57+
# create_self_signed_cert only writes to stderr if $VERBOSE is true.
58+
# Set it here to not rely on arguments supplied to the ruby binary
59+
old_verbose, $VERBOSE = $VERBOSE, true
5760

5861
begin
5962
vhost_config1 = {
@@ -85,6 +88,8 @@ def test_sni
8588
ensure
8689
# restore stderr
8790
$stderr = old_stderr
91+
# restore $VERBOSE
92+
$VERBOSE = old_verbose
8893
end
8994

9095
assert_match(/\A([.+*]+\n)+\z/, stderr_buffer.string)

0 commit comments

Comments
 (0)