Home

Awesome

Riot::Rack

Use Riot to test your Rack apps easily!

Here's the gist of it:

require 'riot'
require 'riot/rack'

context "HelloWorldApp" do
  # Specify your app using the #app helper. If you don't specify
  # one, Riot::Rack will recursively look for a config.ru file.
  # Takes either an app class or a block argument.
  app {|env| [200, {}, "Hello, World!"] }
  
  # Alternatively:
  app(HelloWorldApp)
  
  # You can use all the Rack::Test helpers in the setup blocks.
  setup { get '/' }
  
  # You can access the response directly.
  asserts(:status).equals(200)
  asserts(:body).equals("Hello, World!")
end

Installation

Add Gemcutter to your gem sources:

sudo gem sources -a http://gemcutter.org

Then, simply install the riot-rack gem like so:

sudo gem install riot-rack

Prerequisites

License

Copyright (c) 2010 Daniel Schierbeck, Brian Carlson.

Riot is released under the MIT license. See {file:MIT-LICENSE}.