test_clogger: workaround test failure on 32-bit
authorEric Wong <normalperson@yhbt.net>
Mon, 12 May 2014 06:39:04 +0000 (12 06:39 +0000)
committerEric Wong <normalperson@yhbt.net>
Mon, 12 May 2014 06:39:04 +0000 (12 06:39 +0000)
StringIO isn't a very realistic use case, and our changing
the length of a shared string causes errors on 32-bit.

test/test_clogger.rb

index b47c112..953152e 100644 (file)
@@ -222,12 +222,11 @@ class TestClogger < Test::Unit::TestCase
     req = @req.merge("HTTP_X_FORWARDED_FOR" => '192.168.1.1')
     status, headers, body = cl.call(req)
     assert_equal "192.168.1.1\n", str.string
-    str.rewind
-    str.truncate(0)
+
+    str = StringIO.new
+    cl = Clogger.new(app, :logger => str, :format => "$ip")
     status, headers, body = cl.call(@req)
     assert_equal "home\n", str.string
-    str.rewind
-    str.truncate(0)
   end
 
   def test_rack_1_0