summaryrefslogtreecommitdiff
path: root/test/net
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-09 02:49:13 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-09 02:49:13 +0000
commit0babd248270c0e108ef593b36d0fd188c966ecbb (patch)
tree2d5caeb914dabf7d9a7fe25cb0caf9350031aaf8 /test/net
parentf367fe81b1c1b71bf0e4094d1abdefd1a5ded423 (diff)
* 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.rb1
-rw-r--r--test/net/http/test_https.rb1
-rw-r--r--test/net/http/utils.rb5
3 files changed, 6 insertions, 1 deletions
diff --git a/test/net/http/test_http.rb b/test/net/http/test_http.rb
index 704456f..bd0d960 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 0df003b..89845c5 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 7afef41..3bf7695 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,
}