Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Test helper for Sinatra (extracted from BigBand).

tree: b2e7fb7c09

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 README.md
Octocat-spinner-32 sinatra-test-helper.gemspec
README.md

Sinatra::TestHelper

Adds helper methods and better integration for various testing frameworks to Sinatra.

BigBand

Sinatra::TestHelper is part of the BigBand stack. Check it out if you are looking for other fancy Sinatra extensions.

Installation

gem install sinatra-test-helper

Frameworks

Currently Sinatra::TestHelper ships with support for:

  • Bacon
  • Contest
  • Minitest
  • MSpec
  • Protest
  • RSpec
  • Test::Spec
  • Test::Unit

Usage

In you test_helper.rb or spec_helper.rb (or your test), place this line:

require "sinatra/YOUR_FRAMEWORK"

Example:

require "sinatra/rspec"
require "sinatra/funky_extension"

describe Sinatra::FunkyExtension do
  # Let's always start with an empty app, using Sinatra::FunkyExtension
  before { app :FunkyExtension }
  it "should do funky thinks" do
    define_route(:get, '/funky') { "funky" }
    browse_route(:get, '/funky').body.should == "funky"
  end
end
Something went wrong with that request. Please try again.