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

Methods
#
B
E
M
N
Attributes
[RW] errors

Errors

[R] original_headers

Headers

Class Public methods
new(status, headers, body, errors=StringIO.new(""))
# File lib/rack/mock.rb, line 163
def initialize(status, headers, body, errors=StringIO.new(""))
  @original_headers = headers
  @errors           = errors.string if errors.respond_to?(:string)

  super(body, status, headers)
end
Instance Public methods
=~(other)
# File lib/rack/mock.rb, line 170
def =~(other)
  body =~ other
end
body()
# File lib/rack/mock.rb, line 178
def body
  # FIXME: apparently users of MockResponse expect the return value of
  # MockResponse#body to be a string.  However, the real response object
  # returns the body as a list.
  #
  # See spec_showstatus.rb:
  #
  #   should "not replace existing messages" do
  #     ...
  #     res.body.should == "foo!"
  #   end
  super.join
end
empty?()
# File lib/rack/mock.rb, line 192
def empty?
  [201, 204, 304].include? status
end
match(other)
# File lib/rack/mock.rb, line 174
def match(other)
  body.match other
end