diff options
author | Pat Allan <pat@freelancing-gods.com> | 2017-05-21 05:33:35 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2017-05-21 05:38:41 +0000 |
commit | b6ec1891ec6280c186e78ec77b88e6934ca7d653 (patch) | |
tree | 08abe34987c44c73cc37a64067eb947b7ec3d75f /test/test_clogger_to_path.rb | |
parent | 029d072d420f0adf98c620913fe05eba3222e244 (diff) | |
download | clogger-b6ec1891ec6280c186e78ec77b88e6934ca7d653.tar.gz |
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]
Diffstat (limited to 'test/test_clogger_to_path.rb')
-rw-r--r-- | test/test_clogger_to_path.rb | 9 |
1 files changed, 9 insertions, 0 deletions
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 |