Rack::MockResponse provides useful helpers for testing your apps. Usually, you don’t create the MockResponse on your own, but use MockRequest.
(Not documented)
# File lib/rack/mock.rb, line 144 144: def initialize(status, headers, body, errors=StringIO.new("")) 145: @status = status.to_i 146: 147: @original_headers = headers 148: @headers = Rack::Utils::HeaderHash.new 149: headers.each { |field, values| 150: @headers[field] = values 151: @headers[field] = "" if values.empty? 152: } 153: 154: @body = "" 155: body.each { |part| @body << part } 156: 157: @errors = errors.string if errors.respond_to?(:string) 158: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.