diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-09 02:49:13 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-09 02:49:13 +0000 |
commit | 0babd248270c0e108ef593b36d0fd188c966ecbb (patch) | |
tree | 2d5caeb914dabf7d9a7fe25cb0caf9350031aaf8 /test/net | |
parent | f367fe81b1c1b71bf0e4094d1abdefd1a5ded423 (diff) | |
download | ruby-0babd248270c0e108ef593b36d0fd188c966ecbb.tar.gz |
* test/net/http: Examine webrick log.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/net')
-rw-r--r-- | test/net/http/test_http.rb | 1 | ||||
-rw-r--r-- | test/net/http/test_https.rb | 1 | ||||
-rw-r--r-- | test/net/http/utils.rb | 5 |
3 files changed, 6 insertions, 1 deletions
diff --git a/test/net/http/test_http.rb b/test/net/http/test_http.rb index 704456f3a3..bd0d960b96 100644 --- a/test/net/http/test_http.rb +++ b/test/net/http/test_http.rb @@ -277,6 +277,7 @@ module TestNetHTTP_version_1_1_methods end } assert_equal 1, i + @log_pattern = nil # server may encount ECONNRESET end def test_get__implicit_start diff --git a/test/net/http/test_https.rb b/test/net/http/test_https.rb index 0df003bdda..89845c584a 100644 --- a/test/net/http/test_https.rb +++ b/test/net/http/test_https.rb @@ -117,6 +117,7 @@ class TestNetHTTPS < Test::Unit::TestCase end } assert_match(/certificate verify failed/, ex.message) + @log_pattern = /ERROR OpenSSL::SSL::SSLError:/ end def test_identity_verify_failure diff --git a/test/net/http/utils.rb b/test/net/http/utils.rb index 7afef411ec..3bf7695532 100644 --- a/test/net/http/utils.rb +++ b/test/net/http/utils.rb @@ -36,16 +36,19 @@ module TestNetHTTPUtils @server.shutdown @server_thread.join end + assert_match(@log_pattern, @log.string) if @log_pattern # resume global state Net::HTTP.version_1_2 end def spawn_server + @log = StringIO.new('') + @log_pattern = /\A\z/ @config = self.class::CONFIG server_config = { :BindAddress => config('host'), :Port => 0, - :Logger => WEBrick::Log.new(NullWriter.new), + :Logger => WEBrick::Log.new(@log, WEBrick::BasicLog::WARN), :AccessLog => [], :ServerType => Thread, } |