Skip to content

Instantly share code, notes, and snippets.

@christonog
Created April 27, 2012 01:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christonog/2504804 to your computer and use it in GitHub Desktop.
Save christonog/2504804 to your computer and use it in GitHub Desktop.
Code I can use to set up Rspec testing within my sinatra apps
# name this file spec_helper.rb, and put it in the spec directory (root_of_app/spec/[file])
require File.join(File.dirname(__FILE__), '..', 'my_sinatra_app.rb')
require 'sinatra'
require 'rack/test'
#setup test environment
set :environment, :test
set :run, false
set :raise_errors, true
set :logging, false
def app
Sinatra::Application
end
Rspec.configure do |config|
config.include Rack::Test::Methods
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment