[前][次][番号順一覧][スレッド一覧]

ruby-changes:36255

From: akr <ko1@a...>
Date: Sun, 9 Nov 2014 14:06:54 +0900 (JST)
Subject: [ruby-changes:36255] akr:r48336 (trunk): * test/xmlrpc: Test webrick error log is empty.

akr	2014-11-09 14:06:44 +0900 (Sun, 09 Nov 2014)

  New Revision: 48336

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48336

  Log:
    * test/xmlrpc: Test webrick error log is empty.

  Modified files:
    trunk/ChangeLog
    trunk/test/xmlrpc/test_webrick_server.rb
    trunk/test/xmlrpc/webrick_testing.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 48335)
+++ ChangeLog	(revision 48336)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Nov  9 14:06:13 2014  Tanaka Akira  <akr@f...>
+
+	* test/xmlrpc: Test webrick error log is empty.
+
 Sun Nov  9 13:47:02 2014  Koichi Sasada  <ko1@a...>
 
 	* gc.c (is_incremental_marking): use #if/#else because
Index: test/xmlrpc/webrick_testing.rb
===================================================================
--- test/xmlrpc/webrick_testing.rb	(revision 48335)
+++ test/xmlrpc/webrick_testing.rb	(revision 48336)
@@ -2,10 +2,12 @@ require 'timeout' https://github.com/ruby/ruby/blob/trunk/test/xmlrpc/webrick_testing.rb#L2
 
 module TestXMLRPC
 module WEBrick_Testing
-  class DummyLog < WEBrick::BasicLog
-    def initialize() super(self) end
-    def <<(*args) end
+  empty_log = Object.new
+  def empty_log.<<(str)
+    assert_equal('', str)
+    self
   end
+  NoLog = WEBrick::Log.new(empty_log, WEBrick::BasicLog::WARN)
 
   def start_server(config={})
     raise "already started" if defined?(@__server) && @__server
@@ -14,7 +16,7 @@ module WEBrick_Testing https://github.com/ruby/ruby/blob/trunk/test/xmlrpc/webrick_testing.rb#L16
     @__server = WEBrick::HTTPServer.new(
       {
         :BindAddress => "localhost",
-        :Logger => DummyLog.new,
+        :Logger => NoLog,
         :AccessLog => [],
       }.update(config))
     yield @__server
Index: test/xmlrpc/test_webrick_server.rb
===================================================================
--- test/xmlrpc/test_webrick_server.rb	(revision 48335)
+++ test/xmlrpc/test_webrick_server.rb	(revision 48336)
@@ -14,7 +14,7 @@ class Test_Webrick < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/xmlrpc/test_webrick_server.rb#L14
   @@basic_auth = WEBrick::HTTPAuth::BasicAuth.new(
     :Realm => 'auth',
     :UserDB => WEBrick::HTTPAuth::Htpasswd.new(File.expand_path('./htpasswd', File.dirname(__FILE__))),
-    :Logger => Logger.new(File::NULL),
+    :Logger => NoLog,
   )
 
   def create_servlet

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]