unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Micah Chalmer <micah@micahchalmer.net>
To: mongrel-unicorn@rubyforge.org
Subject: [PATCH 1/2] Integration test for --no-default-middleware option
Date: Thu, 6 Jun 2013 23:03:32 -0400	[thread overview]
Message-ID: <5690F44F-E5B5-4D5D-9DDE-44689B1A02AD@micahchalmer.net> (raw)

This adds an integration test to ensure that the -N option
continues to function as documented.
---
t/fails-rack-lint.ru             |  5 +++++
t/t0300-no-default-middleware.sh | 15 +++++++++++++++
2 files changed, 20 insertions(+)
create mode 100644 t/fails-rack-lint.ru
create mode 100644 t/t0300-no-default-middleware.sh

diff --git a/t/fails-rack-lint.ru b/t/fails-rack-lint.ru
new file mode 100644
index 0000000..82bfb5f
--- /dev/null
+++ b/t/fails-rack-lint.ru
@@ -0,0 +1,5 @@
+# This rack app returns an invalid status code, which will cause
+# Rack::Lint to throw an exception if it is present.  This
+# is used to check whether Rack::Lint is in the stack or not.
+
+run lambda {|env| return [42, {}, ["Rack::Lint wasn't there if you see this"]]}
diff --git a/t/t0300-no-default-middleware.sh b/t/t0300-no-default-middleware.sh
new file mode 100644
index 0000000..2e8f8f8
--- /dev/null
+++ b/t/t0300-no-default-middleware.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+. ./test-lib.sh
+t_plan 2 "test the -N / --no-default-middleware option"
+
+t_begin "setup and start" && {
+    unicorn_setup
+    unicorn -N -D -c $unicorn_config fails-rack-lint.ru
+    unicorn_wait_start
+}
+
+t_begin "check exit status with Rack::Lint not present" && {
+    test 42 -eq "$(curl -sf -o/dev/null -w'%{http_code}' http://$listen/)"
+}
+
+t_done
-- 
1.8.2

_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying

             reply	other threads:[~2013-06-07  3:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-07  3:03 Micah Chalmer [this message]
2013-06-07  9:25 ` [PATCH 1/2] Integration test for --no-default-middleware option Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://yhbt.net/unicorn/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5690F44F-E5B5-4D5D-9DDE-44689B1A02AD@micahchalmer.net \
    --to=micah@micahchalmer.net \
    --cc=mongrel-unicorn@rubyforge.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhbt.net/unicorn.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).