In Files

Parent

Methods

Included Modules

Class Index [+]

Quicksearch

Rack::MockResponse

Rack::MockResponse provides useful helpers for testing your apps. Usually, you don’t create the MockResponse on your own, but use MockRequest.

Attributes

status[R]

Status

headers[R]

Headers

original_headers[R]

Headers

body[R]

Body

errors[RW]

Errors

Public Class Methods

new(status, headers, body, errors=StringIO.new("")) click to toggle source

(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

Public Instance Methods

=~(other) click to toggle source

(Not documented)

     # File lib/rack/mock.rb, line 174
174:     def =~(other)
175:       @body =~ other
176:     end
[](field) click to toggle source

(Not documented)

     # File lib/rack/mock.rb, line 166
166:     def [](field)
167:       headers[field]
168:     end
match(other) click to toggle source

(Not documented)

     # File lib/rack/mock.rb, line 178
178:     def match(other)
179:       @body.match other
180:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.