diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-12-16 20:38:10 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2014-05-12 06:33:24 +0000 |
commit | 58f027b6c7bf6bb319e5601594219887770edcc7 (patch) | |
tree | b3020ed3a5f21937792d1e2fc079234e3f37a21e /test/test_clogger_to_path.rb | |
parent | 2b2971794c5deda8fd1b100041c24f06ae55337c (diff) | |
download | clogger-58f027b6c7bf6bb319e5601594219887770edcc7.tar.gz |
: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.
Diffstat (limited to 'test/test_clogger_to_path.rb')
-rw-r--r-- | test/test_clogger_to_path.rb | 37 |
1 files changed, 0 insertions, 37 deletions
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 |