diff options
author | filipe <filipe@19e92222-5c0b-0410-8929-a290d50e31e9> | 2007-09-13 04:00:39 +0000 |
---|---|---|
committer | filipe <filipe@19e92222-5c0b-0410-8929-a290d50e31e9> | 2007-09-13 04:00:39 +0000 |
commit | 6bfa360e4a418cf6d3531334cea185be0878c0ed (patch) | |
tree | b4e0c8bc45b4e6c1a4a39a38514f7d1ae5076bdf /test | |
parent | d9727f3bf1f4ca08e78bd2ac563a1adeba82617b (diff) | |
download | unicorn-6bfa360e4a418cf6d3531334cea185be0878c0ed.tar.gz |
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@585 19e92222-5c0b-0410-8929-a290d50e31e9
Diffstat (limited to 'test')
-rw-r--r-- | test/test_uriclassifier.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/test_uriclassifier.rb b/test/test_uriclassifier.rb index f7c2608..526a921 100644 --- a/test/test_uriclassifier.rb +++ b/test/test_uriclassifier.rb @@ -167,6 +167,25 @@ class URIClassifierTest < Test::Unit::TestCase assert_equal 1,h, "didn't find handler" end + # Verifies that a root mounted ("/") handler + # is the default point, doesn't matter the order we use + # to resgister the URIs + def test_classifier_order + tests = ["/before", "/way_past"] + root = "/" + path = "/path" + + u = URIClassifier.new + u.register(path, 1) + u.register(root, 2) + + tests.each do |uri| + sn, pi, h = u.resolve(uri) + assert_equal root, sn, "didn't get right script name" + assert_equal uri, pi, "didn't get right path info" + assert_equal 2, h, "didn't find handler" + end + end end |