#!/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