[#33640] [Ruby 1.9-Bug#4136][Open] Enumerable#reject should not inherit the receiver's instance variables — Hiro Asari <redmine@...>

Bug #4136: Enumerable#reject should not inherit the receiver's instance variables

10 messages 2010/12/08

[#33667] [Ruby 1.9-Bug#4149][Open] Documentation submission: syslog standard library — mathew murphy <redmine@...>

Bug #4149: Documentation submission: syslog standard library

11 messages 2010/12/10

[#33683] [feature:trunk] Enumerable#categorize — Tanaka Akira <akr@...>

Hi.

14 messages 2010/12/12
[#33684] Re: [feature:trunk] Enumerable#categorize — "Martin J. Dst" <duerst@...> 2010/12/12

[#33687] Towards a standardized AST for Ruby code — Magnus Holm <judofyr@...>

Hey folks,

23 messages 2010/12/12
[#33688] Re: Towards a standardized AST for Ruby code — Charles Oliver Nutter <headius@...> 2010/12/12

On Sun, Dec 12, 2010 at 9:55 AM, Magnus Holm <judofyr@gmail.com> wrote:

[#33689] Re: Towards a standardized AST for Ruby code — "Haase, Konstantin" <Konstantin.Haase@...> 2010/12/12

On Dec 12, 2010, at 17:46 , Charles Oliver Nutter wrote:

[#33763] [Ruby 1.9-Bug#4168][Open] WeakRef is unsafe to use in Ruby 1.9 — Brian Durand <redmine@...>

Bug #4168: WeakRef is unsafe to use in Ruby 1.9

43 messages 2010/12/17

[#33815] trunk warnflags build issue with curb 0.7.9? — Jon <jon.forums@...>

As this may turn out to be a 3rd party issue rather than a bug, I'd like some feedback.

11 messages 2010/12/22

[#33833] Ruby 1.9.2 is going to be released — "Yuki Sonoda (Yugui)" <yugui@...>

-----BEGIN PGP SIGNED MESSAGE-----

15 messages 2010/12/23

[#33846] [Ruby 1.9-Feature#4197][Open] Improvement of the benchmark library — Benoit Daloze <redmine@...>

Feature #4197: Improvement of the benchmark library

15 messages 2010/12/23

[#33910] [Ruby 1.9-Feature#4211][Open] Converting the Ruby and C API documentation to YARD syntax — Loren Segal <redmine@...>

Feature #4211: Converting the Ruby and C API documentation to YARD syntax

10 messages 2010/12/26

[#33923] [Ruby 1.9-Bug#4214][Open] Fiddle::WINDOWS == false on Windows — Jon Forums <redmine@...>

Bug #4214: Fiddle::WINDOWS == false on Windows

15 messages 2010/12/27

[ruby-core:34010] [Ruby 1.9-Bug#4227][Open] Webrick tests use deprecated :RequestHandler option

From: Peter Weldon <redmine@...>
Date: 2010-12-30 21:36:22 UTC
List: ruby-core #34010
Bug #4227: Webrick tests use deprecated :RequestHandler option
http://redmine.ruby-lang.org/issues/show/4227

Author: Peter Weldon
Status: Open, Priority: Normal
Category: test
ruby -v: ruby 1.9.3dev (2010-12-30 trunk 30432) [i386-mingw32]

Patch removes usage of deprecated :RequestHandler option in tests. A test of the deprecation behaviour is also added.


From dc216679bab208a71c4cb3d65fe18bc625c119d9 Mon Sep 17 00:00:00 2001
From: Peter Weldon <peter.weldon@null.net>
Date: Thu, 30 Dec 2010 13:07:58 -0800
Subject: [PATCH] test/webrick/test_(cgi|httpproxy).rb: s/:RequestHandler/:RequestCallback/g - don't use deprecated :RequestHandler

---
 test/webrick/test_cgi.rb        |    2 +-
 test/webrick/test_httpproxy.rb  |   10 +++++-----
 test/webrick/test_httpserver.rb |   18 ++++++++++++++++++
 3 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/test/webrick/test_cgi.rb b/test/webrick/test_cgi.rb
index 4bfb3df..1185316 100644
--- a/test/webrick/test_cgi.rb
+++ b/test/webrick/test_cgi.rb
@@ -10,7 +10,7 @@ class TestWEBrickCGI < Test::Unit::TestCase
       :CGIInterpreter => TestWEBrick::RubyBin,
       :DocumentRoot => File.dirname(__FILE__),
       :DirectoryIndex => ["webrick.cgi"],
-      :RequestHandler => Proc.new{|req, res|
+      :RequestCallback => Proc.new{|req, res|
         def req.meta_vars
           meta = super
           meta["RUBYLIB"] = $:.join(File::PATH_SEPARATOR)
diff --git a/test/webrick/test_httpproxy.rb b/test/webrick/test_httpproxy.rb
index 58b834f..cab7095 100644
--- a/test/webrick/test_httpproxy.rb
+++ b/test/webrick/test_httpproxy.rb
@@ -33,7 +33,7 @@ class TestWEBrickHTTPProxy < Test::Unit::TestCase
     config = {
       :ServerName => "localhost.localdomain",
       :ProxyContentHandler => Proc.new{|req, res| proxy_handler_called += 1 },
-      :RequestHandler => Proc.new{|req, res| request_handler_called += 1 }
+      :RequestCallback => Proc.new{|req, res| request_handler_called += 1 }
     }
     TestWEBrick.start_httpproxy(config){|server, addr, port, log|
       server.mount_proc("/"){|req, res|
@@ -78,7 +78,7 @@ class TestWEBrickHTTPProxy < Test::Unit::TestCase
     config = {
       :ServerName => "localhost.localdomain",
       :ProxyContentHandler => Proc.new{|req, res| proxy_handler_called += 1 },
-      :RequestHandler => Proc.new{|req, res| request_handler_called += 1 }
+      :RequestCallback => Proc.new{|req, res| request_handler_called += 1 }
     }
     TestWEBrick.start_httpproxy(config){|server, addr, port, log|
       server.mount_proc("/"){|req, res|
@@ -143,7 +143,7 @@ class TestWEBrickHTTPProxy < Test::Unit::TestCase
     }
     config = {
       :ServerName => "localhost.localdomain",
-      :RequestHandler => Proc.new{|req, res|
+      :RequestCallback => Proc.new{|req, res|
         assert_equal("CONNECT", req.request_method)
       },
     }
@@ -185,7 +185,7 @@ class TestWEBrickHTTPProxy < Test::Unit::TestCase
     up_config = {
       :ServerName => "localhost.localdomain",
       :ProxyContentHandler => Proc.new{|req, res| up_proxy_handler_called += 1},
-      :RequestHandler => Proc.new{|req, res| up_request_handler_called += 1}
+      :RequestCallback => Proc.new{|req, res| up_request_handler_called += 1}
     }
     TestWEBrick.start_httpproxy(up_config){|up_server, up_addr, up_port, up_log|
       up_server.mount_proc("/"){|req, res|
@@ -195,7 +195,7 @@ class TestWEBrickHTTPProxy < Test::Unit::TestCase
         :ServerName => "localhost.localdomain",
         :ProxyURI => URI.parse("http://localhost:#{up_port}"),
         :ProxyContentHandler => Proc.new{|req, res| proxy_handler_called += 1},
-        :RequestHandler => Proc.new{|req, res| request_handler_called += 1},
+        :RequestCallback => Proc.new{|req, res| request_handler_called += 1},
       }
       TestWEBrick.start_httpproxy(config){|server, addr, port, log|
         http = Net::HTTP.new(up_addr, up_port, addr, port)
diff --git a/test/webrick/test_httpserver.rb b/test/webrick/test_httpserver.rb
index e0c2ae3..b4bdd84 100644
--- a/test/webrick/test_httpserver.rb
+++ b/test/webrick/test_httpserver.rb
@@ -257,4 +257,22 @@ class TestWEBrickHTTPServer < Test::Unit::TestCase
     assert_equal(started, 1)
     assert_equal(stopped, 1)
   end
+
+  def test_request_handler_callback_is_deprecated
+    requested = 0
+    config = {
+      :ServerName => "localhost",
+      :RequestHandler => Proc.new{|req, res| requested += 1 },
+    }
+    TestWEBrick.start_httpserver(config){|server, addr, port, log|
+      true while server.status != :Running
+
+      http = Net::HTTP.new(addr, port)
+      req = Net::HTTP::Get.new("/")
+      req["Host"] = "localhost:#{port}"
+      http.request(req){|res| assert_equal("404", res.code, log.call)}
+      assert_match(%r{:RequestHandler is deprecated, please use :RequestCallback$}, log.call, log.call)
+    }
+    assert_equal(requested, 1)
+  end
 end
-- 
1.7.1.msysgit.0


----------------------------------------
http://redmine.ruby-lang.org

In This Thread

Prev Next