1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/webrick: Examine log and use assert_join_threads.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2014-11-08 15:38:33 +00:00
parent 8222432c9d
commit 742bbbb01b
6 changed files with 65 additions and 28 deletions

View file

@ -4,9 +4,16 @@ require "webrick"
require_relative "utils"
class TestWEBrickHTTPServer < Test::Unit::TestCase
empty_log = Object.new
def empty_log.<<(str)
assert_equal('', str)
self
end
NoLog = WEBrick::Log.new(empty_log, WEBrick::BasicLog::WARN)
def test_mount
httpd = WEBrick::HTTPServer.new(
:Logger => WEBrick::Log.new(TestWEBrick::NullWriter),
:Logger => NoLog,
:DoNotListen=>true
)
httpd.mount("/", :Root)
@ -75,7 +82,7 @@ class TestWEBrickHTTPServer < Test::Unit::TestCase
def httpd(addr, port, host, ali)
config ={
:Logger => WEBrick::Log.new(TestWEBrick::NullWriter),
:Logger => NoLog,
:DoNotListen => true,
:BindAddress => addr,
:Port => port,
@ -229,7 +236,7 @@ class TestWEBrickHTTPServer < Test::Unit::TestCase
:BindAddress => addr,
:Port => port,
:DoNotListen => true,
:Logger => WEBrick::Log.new(TestWEBrick::NullWriter),
:Logger => NoLog,
:AccessLog => [],
:RequestCallback => Proc.new{|req, res| requested1 += 1 },
}