mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/xmlrpc: Test webrick error log is empty.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a11aa75662
commit
a4b5982b4c
3 changed files with 11 additions and 5 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Sun Nov 9 14:06:13 2014 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* test/xmlrpc: Test webrick error log is empty.
|
||||||
|
|
||||||
Sun Nov 9 13:47:02 2014 Koichi Sasada <ko1@atdot.net>
|
Sun Nov 9 13:47:02 2014 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
* gc.c (is_incremental_marking): use #if/#else because
|
* gc.c (is_incremental_marking): use #if/#else because
|
||||||
|
|
|
@ -14,7 +14,7 @@ class Test_Webrick < Test::Unit::TestCase
|
||||||
@@basic_auth = WEBrick::HTTPAuth::BasicAuth.new(
|
@@basic_auth = WEBrick::HTTPAuth::BasicAuth.new(
|
||||||
:Realm => 'auth',
|
:Realm => 'auth',
|
||||||
:UserDB => WEBrick::HTTPAuth::Htpasswd.new(File.expand_path('./htpasswd', File.dirname(__FILE__))),
|
:UserDB => WEBrick::HTTPAuth::Htpasswd.new(File.expand_path('./htpasswd', File.dirname(__FILE__))),
|
||||||
:Logger => Logger.new(File::NULL),
|
:Logger => NoLog,
|
||||||
)
|
)
|
||||||
|
|
||||||
def create_servlet
|
def create_servlet
|
||||||
|
|
|
@ -2,10 +2,12 @@ require 'timeout'
|
||||||
|
|
||||||
module TestXMLRPC
|
module TestXMLRPC
|
||||||
module WEBrick_Testing
|
module WEBrick_Testing
|
||||||
class DummyLog < WEBrick::BasicLog
|
empty_log = Object.new
|
||||||
def initialize() super(self) end
|
def empty_log.<<(str)
|
||||||
def <<(*args) end
|
assert_equal('', str)
|
||||||
|
self
|
||||||
end
|
end
|
||||||
|
NoLog = WEBrick::Log.new(empty_log, WEBrick::BasicLog::WARN)
|
||||||
|
|
||||||
def start_server(config={})
|
def start_server(config={})
|
||||||
raise "already started" if defined?(@__server) && @__server
|
raise "already started" if defined?(@__server) && @__server
|
||||||
|
@ -14,7 +16,7 @@ module WEBrick_Testing
|
||||||
@__server = WEBrick::HTTPServer.new(
|
@__server = WEBrick::HTTPServer.new(
|
||||||
{
|
{
|
||||||
:BindAddress => "localhost",
|
:BindAddress => "localhost",
|
||||||
:Logger => DummyLog.new,
|
:Logger => NoLog,
|
||||||
:AccessLog => [],
|
:AccessLog => [],
|
||||||
}.update(config))
|
}.update(config))
|
||||||
yield @__server
|
yield @__server
|
||||||
|
|
Loading…
Reference in a new issue