Created
May 13, 2009 04:49
-
-
Save avdi/110881 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
gem 'rack', '=0.9.1' | |
gem 'thin', '=1.0.0' | |
require 'sinatra' | |
get '/' do | |
content_type 'text/plain' | |
"Hello, world" | |
end | |
# Run me with 'spec' executable to run my specs! | |
if $0 =~ /spec$/ | |
set :environment, :test | |
set :run, false # Don't autostart server | |
require 'spec/interop/test' | |
require 'sinatra/test' | |
describe "Example App" do | |
include Sinatra::Test | |
it "should serve a greeting" do | |
get '/' | |
response.should be_ok | |
response.body.should == "Hello, world" | |
end | |
it "should serve content as text/plain" do | |
get '/' | |
response.headers['Content-Type'].should == 'text/plain' | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment