Class: ActiveResource::HttpMock::Responder

Inherits:
Object
  • Object
show all
Defined in:
lib/active_resource/persistent_http_mock.rb

Overview

Add PATCH support

Instance Method Summary collapse

Instance Method Details

#patch(path, request_headers = {}, body = nil, status = 200, response_headers = {}) ⇒ Object



46
47
48
49
50
51
52
53
# File 'lib/active_resource/persistent_http_mock.rb', line 46

def patch(path, request_headers = {}, body = nil, status = 200, response_headers = {})
  request  = ActiveResource::Request.new(:patch, path, nil, request_headers)
  response = ActiveResource::Response.new(body || "", status, response_headers)

  delete_duplicate_responses(request)

  @responses << [request, response]
end