about summary refs log tree commit homepage
path: root/test
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-03-20 19:46:44 -0700
committerEric Wong <normalperson@yhbt.net>2010-03-20 19:47:29 -0700
commit36d0fa866ac696ee8acde74f2cffccd06ab8e816 (patch)
tree4f0d523851ea00315685c1ec4c2b7d4899577b00 /test
parentb1e90244af775cc6713a531f4194726e35df5379 (diff)
downloadunicorn-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')
-rw-r--r--test/rails/test_rails.rb2
-rw-r--r--test/unit/test_util.rb10
2 files changed, 6 insertions, 6 deletions
diff --git a/test/rails/test_rails.rb b/test/rails/test_rails.rb
index 304f519..6742722 100644
--- a/test/rails/test_rails.rb
+++ b/test/rails/test_rails.rb
@@ -234,7 +234,7 @@ logger Logger.new('#{COMMON_TMP.path}')
   def test_alt_url_root_config_env
     # cbf to actually work on this since I never use this feature (ewong)
     return unless ROR_V[0] >= 2 && ROR_V[1] >= 3
-    tmp = Tempfile.new(nil)
+    tmp = Tempfile.new('')
     tmp.syswrite("ENV['RAILS_RELATIVE_URL_ROOT'] = '/poo'\n")
     redirect_test_io do
       @pid = fork { exec 'unicorn_rails', "-l#@addr:#@port", "-c", tmp.path }
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|