about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-08-16 22:08:11 +0000
committerEric Wong <normalperson@yhbt.net>2013-08-17 01:09:46 +0000
commit9af083d7f6b97c0f5ebbdd9a42b58478a6f874b7 (patch)
tree1beb6864bed522b2fb900025f338690382994a6f
parent24b9f66dcdda44378b4053645333ce9ce336b413 (diff)
downloadunicorn-9af083d7f6b97c0f5ebbdd9a42b58478a6f874b7.tar.gz
As of r40610 in ruby trunk, internal encoding is ignored if
external coding is ASCII-8BIT (binary)

ref: r40610 http://svn.ruby-lang.org/repos/ruby/trunk
-rw-r--r--test/unit/test_util.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/unit/test_util.rb b/test/unit/test_util.rb
index b8e4043..904d51c 100644
--- a/test/unit/test_util.rb
+++ b/test/unit/test_util.rb
@@ -80,7 +80,11 @@ class TestUtil < Test::Unit::TestCase
         File.open(tmp_path, "a:#{ext.to_s}:#{int.to_s}") { |fp|
           fp.sync = true
           assert_equal ext, fp.external_encoding
-          assert_equal int, fp.internal_encoding
+
+          if ext != Encoding::BINARY
+            assert_equal int, fp.internal_encoding
+          end
+
           File.unlink(tmp_path)
           assert ! File.exist?(tmp_path)
           Unicorn::Util.reopen_logs
@@ -88,7 +92,9 @@ class TestUtil < Test::Unit::TestCase
           assert File.exist?(tmp_path)
           assert_equal fp.stat.inspect, File.stat(tmp_path).inspect
           assert_equal ext, fp.external_encoding
-          assert_equal int, fp.internal_encoding
+          if ext != Encoding::BINARY
+            assert_equal int, fp.internal_encoding
+          end
           assert_equal(EXPECT_FLAGS, EXPECT_FLAGS & fp.fcntl(Fcntl::F_GETFL))
           assert fp.sync
         }