diff --git a/lib/sinatra/base.rb b/lib/sinatra/base.rb index c259b9da..d3e9dc22 100644 --- a/lib/sinatra/base.rb +++ b/lib/sinatra/base.rb @@ -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) diff --git a/test/routing_test.rb b/test/routing_test.rb index edadc012..c36a6f95 100644 --- a/test/routing_test.rb +++ b/test/routing_test.rb @@ -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