diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-03-20 19:46:44 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-03-20 19:47:29 -0700 |
commit | 36d0fa866ac696ee8acde74f2cffccd06ab8e816 (patch) | |
tree | 4f0d523851ea00315685c1ec4c2b7d4899577b00 /test/unit | |
parent | b1e90244af775cc6713a531f4194726e35df5379 (diff) | |
download | unicorn-36d0fa866ac696ee8acde74f2cffccd06ab8e816.tar.gz |
Avoid Tempfile.new(nil), which breaks under Ruby 1.9.2 and was probably a bad idea to begin with.
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/test_util.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/unit/test_util.rb b/test/unit/test_util.rb index 4a1e21f..b267179 100644 --- a/test/unit/test_util.rb +++ b/test/unit/test_util.rb @@ -7,7 +7,7 @@ class TestUtil < Test::Unit::TestCase EXPECT_FLAGS = File::WRONLY | File::APPEND def test_reopen_logs_noop - tmp = Tempfile.new(nil) + tmp = Tempfile.new('') tmp.reopen(tmp.path, 'a') tmp.sync = true ext = tmp.external_encoding rescue nil @@ -21,14 +21,14 @@ class TestUtil < Test::Unit::TestCase end def test_reopen_logs_renamed - tmp = Tempfile.new(nil) + tmp = Tempfile.new('') tmp_path = tmp.path.freeze tmp.reopen(tmp_path, 'a') tmp.sync = true ext = tmp.external_encoding rescue nil int = tmp.internal_encoding rescue nil before = tmp.stat.inspect - to = Tempfile.new(nil) + to = Tempfile.new('') File.rename(tmp_path, to.path) assert ! File.exist?(tmp_path) Unicorn::Util.reopen_logs @@ -45,7 +45,7 @@ class TestUtil < Test::Unit::TestCase end def test_reopen_logs_renamed_with_encoding - tmp = Tempfile.new(nil) + tmp = Tempfile.new('') tmp_path = tmp.path.dup.freeze Encoding.list.each { |encoding| File.open(tmp_path, "a:#{encoding.to_s}") { |fp| @@ -68,7 +68,7 @@ class TestUtil < Test::Unit::TestCase end if STDIN.respond_to?(:external_encoding) def test_reopen_logs_renamed_with_internal_encoding - tmp = Tempfile.new(nil) + tmp = Tempfile.new('') tmp_path = tmp.path.dup.freeze Encoding.list.each { |ext| Encoding.list.each { |int| |