Class Rack::MockRequest
In: lib/rack/mock.rb
Parent: Object

Rack::MockRequest helps testing your Rack application without actually using HTTP.

After performing a request on a URL with get/post/put/delete, it returns a MockResponse with useful helper methods for effective testing.

You can pass a hash with additional configuration to the get/post/put/delete.

:input:A String or IO-like to be used as rack.input.
:fatal:Raise a FatalWarning if the app writes to rack.errors.
:lint:If true, wrap the application in a Rack::Lint.

Methods

delete   env_for   get   new   post   put   request  

Classes and Modules

Class Rack::MockRequest::FatalWarner
Class Rack::MockRequest::FatalWarning

Constants

DEFAULT_ENV = { "rack.version" => Rack::VERSION, "rack.input" => StringIO.new, "rack.errors" => StringIO.new, "rack.multithread" => true, "rack.multiprocess" => true, "rack.run_once" => false, }

Public Class methods

Return the Rack environment used for a request to uri.

Public Instance methods

[Validate]