summaryrefslogtreecommitdiff
path: root/test/net
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-09 11:51:06 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-09 11:51:06 +0000
commit070c310e87d04865da1b4f217432e22cfae5e380 (patch)
treed11d9ef6c67b447bc886182b9c02e38aa70a3a00 /test/net
parent9b559f194c9960e66011b8f40d428fe36cb302be (diff)
* test/webrick: Store log in an array.
* test/net/http: Ditto. * test/open-uri: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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'),