From b6ec1891ec6280c186e78ec77b88e6934ca7d653 Mon Sep 17 00:00:00 2001 From: Pat Allan Date: Sun, 21 May 2017 05:33:35 +0000 Subject: Update respond_to? calls for second argument. Rack (since v2) has started explicitly listing the second (optional) argument for respond_to?, which matches the underlying Ruby spec. This patch fixes the calls in both C and Ruby approaches. [ew: add test, use rb_obj_respond_to if available] --- test/test_clogger_to_path.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test') diff --git a/test/test_clogger_to_path.rb b/test/test_clogger_to_path.rb index b437695..f74b991 100644 --- a/test/test_clogger_to_path.rb +++ b/test/test_clogger_to_path.rb @@ -14,6 +14,10 @@ class MyBody < Struct.new(:to_path, :closed) def close self.closed = true end + +private + def privtest + end end class TestCloggerToPath < Test::Unit::TestCase @@ -59,6 +63,11 @@ class TestCloggerToPath < Test::Unit::TestCase status, headers, body = app.call(@req) assert_instance_of(Clogger, body) check_body(body) + + assert ! body.respond_to?(:privtest) + assert body.respond_to?(:privtest, true) + assert ! body.respond_to?(:privtest, false) + assert logger.string.empty? assert_equal tmp.path, body.to_path body.close -- cgit v1.2.3-24-ge0c7