Created
February 4, 2014 04:00
-
-
Save biscuitvile/8797951 to your computer and use it in GitHub Desktop.
test_helper for sinatra
This file contains hidden or 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
| require 'rubygems' | |
| require 'test/unit' | |
| require 'rack/test' | |
| $LOAD_PATH.unshift(File.dirname(__FILE__)) | |
| require 'sinatra/erector' | |
| class Test::Unit::TestCase | |
| include Rack::Test::Methods | |
| attr_reader :app | |
| # Sets up a Sinatra::Base subclass defined with the block | |
| # given. Used in setup or individual spec methods to establish | |
| # the application. | |
| def mock_app(base=Sinatra::Base, &block) | |
| @app = Sinatra.new(base, &block) | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment