Sha256: 3bd3dde91862cc91bbcf272ce23b4df1ed0155bf0d10569c716949827c21cdde
Contents?: true
Size: 826 Bytes
Versions: 20
Compression:
Stored size: 826 Bytes
Contents
# encoding: utf-8 require 'spec_helper' describe Hyperdrive::Middleware::RequestMethod do def app inner_app = ->(env) { [200, {}, ['']] } Hyperdrive::Middleware::RequestMethod.new(inner_app) end before do @resource = default_resource @env = default_rack_env(@resource) end it "is successful if the request method is supported" do get '/', {}, @env last_response.successful?.must_equal true end it "throws an error if hyperdrive doesn't support the request method" do ->{ request('/', @env.merge('REQUEST_METHOD' => 'TRACE')) }.must_raise Hyperdrive::Errors::NotImplemented end it "throws an error if the resource doesn't support the request method" do ->{ post('/', {}, @env.merge('REQUEST_METHOD' => 'POST')) }.must_raise Hyperdrive::Errors::MethodNotAllowed end end
Version data entries
20 entries across 20 versions & 1 rubygems