Created
April 27, 2012 01:19
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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