about summary refs log tree commit homepage
path: root/test
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-02-26 16:18:56 -0800
committerEric Wong <normalperson@yhbt.net>2009-03-03 11:13:01 -0800
commite66ab79b8b5bc5311c750bf03868a7b2574f4ea1 (patch)
tree834773540c945b02e625f75e466c2d531b5e97c9 /test
parent29cac8016a09f3a0f9e941ca51db3f0a6df98b60 (diff)
downloadunicorn-e66ab79b8b5bc5311c750bf03868a7b2574f4ea1.tar.gz
Since not all rackup command-line options can be supported by
Unicorn, disable this gross hack to avoid potentially
unpredictable or undefined behavior.  config.ru will not be able
to specify the config file for unicorn-specific options; but the
unicorn-specific config files themselves will be allowed to
override the default config.ru location.
Diffstat (limited to 'test')
-rw-r--r--test/exec/test_exec.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/exec/test_exec.rb b/test/exec/test_exec.rb
index 9f65ce3..5ba5d9c 100644
--- a/test/exec/test_exec.rb
+++ b/test/exec/test_exec.rb
@@ -310,14 +310,18 @@ end # after_fork
     assert status.success?, "exited successfully"
   end
 
-  def test_read_embedded_cli_switches
+  def test_ignore_embedded_cli_switches
+    port2 = unused_port(@addr)
     File.open("config.ru", "wb") do |fp|
-      fp.syswrite("#\\ -p #{@port} -o #{@addr}\n")
+      fp.syswrite("#\\ -p #{port2} -o #{@addr}\n")
       fp.syswrite(HI)
     end
-    pid = fork { redirect_test_io { exec($unicorn_bin) } }
+    pid = fork do
+      redirect_test_io { exec($unicorn_bin, "-l#{@addr}:#{@port}") }
+    end
     results = retry_hit(["http://#{@addr}:#{@port}/"])
     assert_equal String, results[0].class
+    assert_raises(Errno::ECONNREFUSED) { TCPSocket.new(@addr, port2) }
     assert_shutdown(pid)
   end