about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-12-08 23:53:25 +0000
committerEric Wong <normalperson@yhbt.net>2010-12-09 07:54:31 +0800
commit9d80b009a3cb795530ad23263f4eb525880e79dc (patch)
tree66fb4b740866b3ea67e2c7c4377789794918f1b6
parent3b2fc62dadd3c90038c168849b33c4ca6df058da (diff)
downloadunicorn-9d80b009a3cb795530ad23263f4eb525880e79dc.tar.gz
This has been broken since 2.0.x
Internal cleanups sometimes have unintended consequences :<
-rw-r--r--lib/unicorn/configurator.rb1
-rwxr-xr-xt/t0015-configurator-internals.sh25
2 files changed, 26 insertions, 0 deletions
diff --git a/lib/unicorn/configurator.rb b/lib/unicorn/configurator.rb
index 2a83dea..3cacb91 100644
--- a/lib/unicorn/configurator.rb
+++ b/lib/unicorn/configurator.rb
@@ -9,6 +9,7 @@ require 'logger'
 # nginx is also available at
 # http://unicorn.bogomips.org/examples/nginx.conf
 class Unicorn::Configurator
+  include Unicorn
   attr_accessor :set, :config_file, :after_reload
 
   # :stopdoc:
diff --git a/t/t0015-configurator-internals.sh b/t/t0015-configurator-internals.sh
new file mode 100755
index 0000000..4e3acbe
--- /dev/null
+++ b/t/t0015-configurator-internals.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+. ./test-lib.sh
+t_plan 4 "configurator internals tests (from FAQ)"
+
+t_begin "setup and start" && {
+        unicorn_setup
+        cat >> $unicorn_config <<EOF
+HttpRequest::DEFAULTS["rack.url_scheme"] = "https"
+Configurator::DEFAULTS[:logger].formatter = Logger::Formatter.new
+EOF
+        unicorn -D -c $unicorn_config env.ru
+        unicorn_wait_start
+}
+
+t_begin "single request" && {
+        curl -sSfv http://$listen/ | grep '"rack.url_scheme"=>"https"'
+}
+
+t_begin "killing succeeds" && {
+        kill $unicorn_pid
+}
+
+t_begin "no errors" && check_stderr
+
+t_done