summaryrefslogtreecommitdiff
path: root/test/net
diff options
context:
space:
mode:
Diffstat (limited to 'test/net')
-rw-r--r--test/net/http/test_http.rb2
-rw-r--r--test/net/http/test_https.rb5
-rw-r--r--test/net/http/utils.rb6
3 files changed, 8 insertions, 5 deletions
diff --git a/test/net/http/test_http.rb b/test/net/http/test_http.rb
index bd0d960..90336b2 100644
--- a/test/net/http/test_http.rb
+++ b/test/net/http/test_http.rb
@@ -277,7 +277,7 @@ module TestNetHTTP_version_1_1_methods
end
}
assert_equal 1, i
- @log_pattern = nil # server may encount ECONNRESET
+ @log_tester = 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 89845c5..bff2b4a 100644
--- a/test/net/http/test_https.rb
+++ b/test/net/http/test_https.rb
@@ -117,7 +117,10 @@ class TestNetHTTPS < Test::Unit::TestCase
end
}
assert_match(/certificate verify failed/, ex.message)
- @log_pattern = /ERROR OpenSSL::SSL::SSLError:/
+ @log_tester = lambda {|log|
+ assert_equal(1, log.length)
+ assert_match(/ERROR OpenSSL::SSL::SSLError:/, log[0])
+ }
end
def test_identity_verify_failure
diff --git a/test/net/http/utils.rb b/test/net/http/utils.rb
index 3bf7695..dcd9469 100644
--- a/test/net/http/utils.rb
+++ b/test/net/http/utils.rb
@@ -36,14 +36,14 @@ module TestNetHTTPUtils
@server.shutdown
@server_thread.join
end
- assert_match(@log_pattern, @log.string) if @log_pattern
+ @log_tester.call(@log) if @log_tester
# resume global state
Net::HTTP.version_1_2
end
def spawn_server
- @log = StringIO.new('')
- @log_pattern = /\A\z/
+ @log = []
+ @log_tester = lambda {|log| assert_equal([], log ) }
@config = self.class::CONFIG
server_config = {
:BindAddress => config('host'),