mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
add support for the PATCH verb
This commit is contained in:
parent
e68e2191f9
commit
cdc73c8f5c
2 changed files with 2 additions and 1 deletions
|
@ -1094,6 +1094,7 @@ module Sinatra
|
|||
def delete(path, opts={}, &bk) route 'DELETE', path, opts, &bk end
|
||||
def head(path, opts={}, &bk) route 'HEAD', path, opts, &bk end
|
||||
def options(path, opts={}, &bk) route 'OPTIONS', path, opts, &bk end
|
||||
def patch(path, opts={}, &bk) route 'PATCH', path, opts, &bk end
|
||||
|
||||
private
|
||||
def route(verb, path, options={}, &block)
|
||||
|
|
|
@ -23,7 +23,7 @@ class RegexpLookAlike
|
|||
end
|
||||
|
||||
class RoutingTest < Test::Unit::TestCase
|
||||
%w[get put post delete options].each do |verb|
|
||||
%w[get put post delete options patch].each do |verb|
|
||||
it "defines #{verb.upcase} request handlers with #{verb}" do
|
||||
mock_app {
|
||||
send verb, '/hello' do
|
||||
|
|
Loading…
Reference in a new issue