mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
Run all "literally matches" tests, and fix the failing one for '$'.
The "literally matches" tests in routing_test.rb differed only by punctuation in the name, so only one of them was actually running. Renaming them exposed a failing test. Signed-off-by: Konstantin Haase <konstantin.mailinglists@googlemail.com>
This commit is contained in:
parent
c1eb806bbb
commit
ff021329b3
2 changed files with 5 additions and 5 deletions
|
@ -1067,7 +1067,7 @@ module Sinatra
|
|||
def compile(path)
|
||||
keys = []
|
||||
if path.respond_to? :to_str
|
||||
special_chars = %w{. + ( )}
|
||||
special_chars = %w{. + ( ) $}
|
||||
pattern =
|
||||
path.to_str.gsub(/((:\w+)|[\*#{special_chars.join}])/) do |match|
|
||||
case match
|
||||
|
|
|
@ -247,7 +247,7 @@ class RoutingTest < Test::Unit::TestCase
|
|||
assert_equal 'right on', body
|
||||
end
|
||||
|
||||
it "literally matches . in paths" do
|
||||
it "literally matches dot in paths" do
|
||||
route_def '/test.bar'
|
||||
|
||||
get '/test.bar'
|
||||
|
@ -256,14 +256,14 @@ class RoutingTest < Test::Unit::TestCase
|
|||
assert not_found?
|
||||
end
|
||||
|
||||
it "literally matches $ in paths" do
|
||||
it "literally matches dollar sign in paths" do
|
||||
route_def '/test$/'
|
||||
|
||||
get '/test$/'
|
||||
assert ok?
|
||||
end
|
||||
|
||||
it "literally matches + in paths" do
|
||||
it "literally matches plus sign in paths" do
|
||||
route_def '/te+st/'
|
||||
|
||||
get '/te%2Bst/'
|
||||
|
@ -272,7 +272,7 @@ class RoutingTest < Test::Unit::TestCase
|
|||
assert not_found?
|
||||
end
|
||||
|
||||
it "literally matches () in paths" do
|
||||
it "literally matches parens in paths" do
|
||||
route_def '/test(bar)/'
|
||||
|
||||
get '/test(bar)/'
|
||||
|
|
Loading…
Reference in a new issue