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:
parent
d9727f3bf1
commit
6bfa360e4a
1 changed files with 19 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue