about summary refs log tree commit homepage
path: root/test
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-02-26 17:31:46 -0800
committerEric Wong <normalperson@yhbt.net>2009-03-03 11:13:02 -0800
commit528b30a9a3f2de1f0f44ef1a4ac65519a0770d58 (patch)
treef1ee6d641421cf14d49723235628995f02286ac0 /test
parente66ab79b8b5bc5311c750bf03868a7b2574f4ea1 (diff)
downloadunicorn-528b30a9a3f2de1f0f44ef1a4ac65519a0770d58.tar.gz
Ensure the output fits in a standard ANSI terminal so it's easy
to read for all users regardless of what interface they're
working from.
Diffstat (limited to 'test')
-rw-r--r--test/exec/test_exec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/exec/test_exec.rb b/test/exec/test_exec.rb
index 5ba5d9c..fb26195 100644
--- a/test/exec/test_exec.rb
+++ b/test/exec/test_exec.rb
@@ -102,6 +102,22 @@ end # after_fork
     assert_shutdown(pid)
   end
 
+  def test_help
+    redirect_test_io do
+      assert(system($unicorn_bin, "-h"), "help text returns true")
+    end
+    assert_equal 0, File.stat("test_stderr.#$$.log").size
+    assert_not_equal 0, File.stat("test_stdout.#$$.log").size
+    lines = File.readlines("test_stdout.#$$.log")
+
+    # Be considerate of the on-call technician working from their
+    # mobile phone or netbook on a slow connection :)
+    assert lines.size < 24, "help height fits in an ANSI terminal window"
+    lines.each do |line|
+      assert line.size < 80, "help width fits in an ANSI terminal window"
+    end
+  end
+
   def test_broken_reexec_config
     File.open("config.ru", "wb") { |fp| fp.syswrite(HI) }
     pid_file = "#{@tmpdir}/test.pid"