about summary refs log tree commit homepage
path: root/test
diff options
context:
space:
mode:
authorIan Ownbey <imownbey@ian-ownbeys-macbook.local>2008-12-01 00:57:05 -0500
committerIan Ownbey <imownbey@ian-ownbeys-macbook.local>2008-12-01 00:57:05 -0500
commit2482c33a3b616ad62d0b564c0d7224dd8432ffdf (patch)
tree0c54730ed7c1be5fbb9ed5d67d91b7e8a819b28c /test
parentc178815ef6496d3d2dfe83b77a0332138a4ae1ee (diff)
downloadunicorn-2482c33a3b616ad62d0b564c0d7224dd8432ffdf.tar.gz
Diffstat (limited to 'test')
-rw-r--r--test/unit/test_configurator.rb88
1 files changed, 0 insertions, 88 deletions
diff --git a/test/unit/test_configurator.rb b/test/unit/test_configurator.rb
deleted file mode 100644
index dc9713a..0000000
--- a/test/unit/test_configurator.rb
+++ /dev/null
@@ -1,88 +0,0 @@
-# Copyright (c) 2005 Zed A. Shaw
-# You can redistribute it and/or modify it under the same terms as Ruby.
-#
-# Additional work donated by contributors.  See http://mongrel.rubyforge.org/attributions.html
-# for more information.
-
-require 'test/test_helper'
-
-$test_plugin_fired = 0
-
-class TestPlugin < GemPlugin::Plugin "/handlers"
-  include Mongrel::HttpHandlerPlugin
-
-  def process(request, response)
-    $test_plugin_fired += 1
-  end
-end
-
-
-class Sentinel < GemPlugin::Plugin "/handlers"
-  include Mongrel::HttpHandlerPlugin
-
-  def process(request, response)
-    raise "This Sentinel plugin shouldn't run."
-  end
-end
-
-
-class ConfiguratorTest < Test::Unit::TestCase
-
-  def test_base_handler_config
-    @port = process_based_port
-    @config = nil
-
-    redirect_test_io do
-      @config = Mongrel::Configurator.new :host => "localhost" do
-        listener :port => process_based_port do
-          # 2 in front should run, but the sentinel shouldn't since dirhandler processes the request
-          uri "/", :handler => plugin("/handlers/testplugin")
-          uri "/", :handler => plugin("/handlers/testplugin")
-          uri "/", :handler => Mongrel::DirHandler.new(".")
-          uri "/", :handler => plugin("/handlers/testplugin")
-
-          uri "/test", :handler => plugin("/handlers/testplugin")
-          uri "/test", :handler => plugin("/handlers/testplugin")
-          uri "/test", :handler => Mongrel::DirHandler.new(".")
-          uri "/test", :handler => plugin("/handlers/testplugin")
-
-          debug "/"
-          setup_signals
-
-          run_config(HERE + "/mongrel.conf")
-          load_mime_map(HERE + "/mime.yaml")
-
-          run
-        end
-      end
-    end
-    
-    # pp @config.listeners.values.first.classifier.routes
-
-    @config.listeners.each do |host,listener|
-      assert listener.classifier.uris.length == 3, "Wrong number of registered URIs"
-      assert listener.classifier.uris.include?("/"),  "/ not registered"
-      assert listener.classifier.uris.include?("/test"), "/test not registered"
-    end
-
-    res = Net::HTTP.get(URI.parse("http://localhost:#{@port}/test"))
-    assert res != nil, "Didn't get a response"
-    assert $test_plugin_fired == 3, "Test filter plugin didn't run 3 times."
-
-    redirect_test_io do
-      res = Net::HTTP.get(URI.parse("http://localhost:#{@port}/"))
-
-      assert res != nil, "Didn't get a response"
-      assert $test_plugin_fired == 6, "Test filter plugin didn't run 6 times."
-    end
-
-    redirect_test_io do
-      @config.stop(false, true)
-    end
-
-    assert_raise Errno::EBADF, Errno::ECONNREFUSED do
-      res = Net::HTTP.get(URI.parse("http://localhost:#{@port}/"))
-    end
-  end
-
-end