diff options
author | zedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9> | 2006-03-26 23:57:11 +0000 |
---|---|---|
committer | zedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9> | 2006-03-26 23:57:11 +0000 |
commit | 4d9966ee00b597cff3b58c851aef65c3801d9077 (patch) | |
tree | f845b065e891869fe6df47fd6ec286146f953d8d /test/test_configurator.rb | |
parent | f2b53a3a4b1ddacac4fc18ccbe2b016194a50777 (diff) | |
download | unicorn-4d9966ee00b597cff3b58c851aef65c3801d9077.tar.gz |
Final touches to get mongrel_rails working. Fixed URI registration bug. Small change to config tool.
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@123 19e92222-5c0b-0410-8929-a290d50e31e9
Diffstat (limited to 'test/test_configurator.rb')
-rw-r--r-- | test/test_configurator.rb | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/test/test_configurator.rb b/test/test_configurator.rb index 2fb9f85..fdc7511 100644 --- a/test/test_configurator.rb +++ b/test/test_configurator.rb @@ -21,7 +21,7 @@ class Sentinel < GemPlugin::Plugin "/handlers" end -class MongrelDbgTest < Test::Unit::TestCase +class ConfiguratorTest < Test::Unit::TestCase def test_base_handler_config config = Mongrel::Configurator.new :host => "localhost" do @@ -30,24 +30,32 @@ class MongrelDbgTest < Test::Unit::TestCase uri "/", :handler => plugin("/handlers/testplugin") uri "/", :handler => plugin("/handlers/testplugin") uri "/", :handler => Mongrel::DirHandler.new(".", load_mime_map("examples/mime.yaml")) - uri "/", :handler => plugin("/handlers/sentinel") + uri "/", :handler => plugin("/handlers/testplugin") uri "/test", :handler => plugin("/handlers/testplugin") uri "/test", :handler => plugin("/handlers/testplugin") uri "/test", :handler => Mongrel::DirHandler.new(".", load_mime_map("examples/mime.yaml")) - uri "/test", :handler => plugin("/handlers/sentinel") + uri "/test", :handler => plugin("/handlers/testplugin") run end end + + config.listeners.each do |host,listener| + puts "Registered URIs: #{listener.classifier.uris.inspect}" + assert listener.classifier.uris.length == 2, "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:3111/test')) assert res != nil, "Didn't get a response" - assert $test_plugin_fired == 2, "Test filter plugin didn't run twice." + assert $test_plugin_fired == 3, "Test filter plugin didn't run 3 times." res = Net::HTTP.get(URI.parse('http://localhost:3111/')) assert res != nil, "Didn't get a response" - assert $test_plugin_fired == 4, "Test filter plugin didn't run 4 times." + assert $test_plugin_fired == 6, "Test filter plugin didn't run 6 times." config.stop |