Created
June 2, 2010 00:45
-
-
Save dcrec1/421757 to your computer and use it in GitHub Desktop.
Sinatra + RSpec
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
require 'spec_helper' | |
describe Sinatra::Application do | |
context "responding to GET /" do | |
it "should return status code 200" | |
get '/' | |
last_response.code.should == 200 | |
end | |
end | |
end |
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
require 'spec/rake/spectask' | |
desc "Run all specs" | |
Spec::Rake::SpecTask.new do |t| | |
t.spec_opts = %w(--format specdoc --color) | |
end |
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
require File.join(File.dirname(__FILE__), '..', 'main.rb') | |
require 'spec' | |
require 'rack/test' | |
Spec::Runner.configure do |conf| | |
conf.include Rack::Test::Methods | |
end | |
def app | |
Sinatra::Application | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment