Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Test helper for Sinatra (extracted from BigBand).
tree: ca35e1c1b6

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib/sinatra
spec
README.md
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.