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 115
115:     def initialize(status, headers, body, errors=StringIO.new(""))
116:       @status = status.to_i
117: 
118:       @original_headers = headers
119:       @headers = Rack::Utils::HeaderHash.new
120:       headers.each { |field, values|
121:         @headers[field] = values
122:         @headers[field] = ""  if values.empty?
123:       }
124: 
125:       @body = ""
126:       body.each { |part| @body << part }
127: 
128:       @errors = errors.string
129:     end

Public Instance Methods

=~(other) click to toggle source

(Not documented)

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

(Not documented)

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

(Not documented)

     # File lib/rack/mock.rb, line 149
149:     def match(other)
150:       @body.match other
151:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.