about summary refs log tree commit homepage
path: root/test/test_conditional.rb
diff options
context:
space:
mode:
authorevanweaver <evanweaver@19e92222-5c0b-0410-8929-a290d50e31e9>2007-10-20 23:15:19 +0000
committerevanweaver <evanweaver@19e92222-5c0b-0410-8929-a290d50e31e9>2007-10-20 23:15:19 +0000
commitfab6173a056990b3c3ed5756ac0624654bb6308f (patch)
treee8e899f002b82fce6179d7873b6f170f1cdacbc3 /test/test_conditional.rb
parent38f36eb891b93547025f2ff60e861de72843663f (diff)
downloadunicorn-fab6173a056990b3c3ed5756ac0624654bb6308f.tar.gz
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@705 19e92222-5c0b-0410-8929-a290d50e31e9
Diffstat (limited to 'test/test_conditional.rb')
-rw-r--r--test/test_conditional.rb24
1 files changed, 6 insertions, 18 deletions
diff --git a/test/test_conditional.rb b/test/test_conditional.rb
index f2f01df..cd3ce06 100644
--- a/test/test_conditional.rb
+++ b/test/test_conditional.rb
@@ -4,19 +4,17 @@
 # Additional work donated by contributors.  See http://mongrel.rubyforge.org/attributions.html
 # for more information.
 
-require 'test/unit'
-require 'net/http'
-require 'mongrel'
+require 'test/testhelp'
 
 include Mongrel
 
 class ConditionalResponseTest < Test::Unit::TestCase
   def setup
-    @h = HttpServer.new('127.0.0.1', 3501)
-    @h.register('/', Mongrel::DirHandler.new('.'))
-    @h.run
+    @server = HttpServer.new('127.0.0.1', 3501)
+    @server.register('/', Mongrel::DirHandler.new('.'))
+    @server.run
     
-    @http = Net::HTTP.new(@h.host, @h.port)
+    @http = Net::HTTP.new(@server.host, @server.port)
 
     # get the ETag and Last-Modified headers
     @path = '/README'
@@ -27,17 +25,7 @@ class ConditionalResponseTest < Test::Unit::TestCase
   end
 
   def teardown
-    orig_stderr = STDERR.dup
-
-    # temporarily disable the puts method in STDERR to silence warnings from stop
-    class << STDERR
-      define_method(:puts) {}
-    end
-
-    @h.stop
-  ensure
-    # restore STDERR
-    STDERR.reopen(orig_stderr)
+    @server.stop(true)
   end
 
   # status should be 304 Not Modified when If-None-Match is the matching ETag