Skip to content

Commit

Permalink
Set VERBOSE to true in test_sni.
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
jackorp committed Nov 21, 2024
1 parent cde6dd4 commit 2d9f0c4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/webrick/test_https.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ def test_sni
# catch stderr in create_self_signed_cert
stderr_buffer = StringIO.new
old_stderr, $stderr = $stderr, stderr_buffer
# create_self_signed_cert only writes to stderr if $VERBOSE is true.
# Set it here to not rely on arguments supplied to the ruby binary
old_verbose, $VERBOSE = $VERBOSE, true

begin
vhost_config1 = {
Expand Down Expand Up @@ -85,6 +88,8 @@ def test_sni
ensure
# restore stderr
$stderr = old_stderr
# restore $VERBOSE
$VERBOSE = old_verbose
end

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

0 comments on commit 2d9f0c4

Please sign in to comment.