Method: Rack::MockResponse#initialize

Defined in:
lib/rack/mock_response.rb

#initialize(status, headers, body, errors = nil) ⇒ MockResponse

Returns a new instance of MockResponse.

[View source]

24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/rack/mock_response.rb', line 24

def initialize(status, headers, body, errors = nil)
  @original_headers = headers

  if errors
    @errors = errors.string if errors.respond_to?(:string)
  else
    @errors = ""
  end

  super(body, status, headers)

  @cookies = parse_cookies_from_header
  buffered_body!
end