| Class | Rack::MockResponse |
| In: |
lib/rack/mock.rb
|
| Parent: | Object |
Rack::MockResponse provides useful helpers for testing your apps. Usually, you don‘t create the MockResponse on your own, but use MockRequest.
| body | [R] | Body |
| errors | [RW] | Errors |
| headers | [R] | Headers |
| original_headers | [R] | Headers |
| status | [R] | Status |
# File lib/rack/mock.rb, line 113
113: def initialize(status, headers, body, errors=StringIO.new(""))
114: @status = status.to_i
115:
116: @original_headers = headers
117: @headers = Rack::Utils::HeaderHash.new
118: headers.each { |field, values|
119: values.each { |value|
120: @headers[field] = value
121: }
122: }
123:
124: @body = ""
125: body.each { |part| @body << part }
126:
127: @errors = errors.string
128: end