From 58f027b6c7bf6bb319e5601594219887770edcc7 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 16 Dec 2013 20:38:10 +0000 Subject: remove :to_io support :to_io never was a Rack extension, and ends up breaking the case where an SSL socket is proxied. The role of :to_io in IO-like objects is to aid IO.select and like methods. --- test/test_clogger_to_path.rb | 37 ------------------------------------- 1 file changed, 37 deletions(-) (limited to 'test') diff --git a/test/test_clogger_to_path.rb b/test/test_clogger_to_path.rb index 4cc9027..b437695 100644 --- a/test/test_clogger_to_path.rb +++ b/test/test_clogger_to_path.rb @@ -93,43 +93,6 @@ class TestCloggerToPath < Test::Unit::TestCase assert_equal "365 200\n", logger.string end - def test_wraps_to_path_to_io - logger = StringIO.new - tmp = Tempfile.new('') - def tmp.to_io - @to_io_called = super - end - def tmp.to_path - path - end - app = Rack::Builder.new do - tmp.syswrite(' ' * 365) - tmp.sysseek(0) - h = { - 'Content-Length' => '0', - 'Content-Type' => 'text/plain', - } - use Clogger, - :logger => logger, - :reentrant => true, - :format => '$body_bytes_sent $status' - run lambda { |env| [ 200, h, tmp ] } - end.to_app - - status, headers, body = app.call(@req) - assert_instance_of(Clogger, body) - check_body(body) - - assert_equal tmp.path, body.to_path - assert_nothing_raised { body.to_io } - assert_kind_of IO, tmp.instance_variable_get(:@to_io_called) - assert logger.string.empty? - assert ! tmp.closed? - body.close - assert tmp.closed? - assert_equal "365 200\n", logger.string - end - def test_does_not_wrap_to_path logger = StringIO.new app = Rack::Builder.new do -- cgit v1.2.3-24-ge0c7