1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Added test that verifies if order of registering uri's matters(test for bug 10279).

git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@585 19e92222-5c0b-0410-8929-a290d50e31e9
This commit is contained in:
filipe 2007-09-13 04:00:39 +00:00
parent d9727f3bf1
commit 6bfa360e4a

View file

@ -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