Created
August 4, 2009 12:41
-
-
Save robholland/161187 to your computer and use it in GitHub Desktop.
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
ENV['RACK_ENV'] = 'test' | |
gem 'rack-test', '=0.3.0' | |
gem 'aslakhellesoy-webrat', '=0.4.4.1' | |
# Sinatra | |
app_file = File.join(File.dirname(__FILE__), *%w[.. .. ranker.rb]) | |
require app_file | |
# Force the application name because polyglot breaks the auto-detection logic. | |
Sinatra::Application.app_file = app_file | |
require 'spec/expectations' | |
require 'rack/test' | |
require 'webrat' | |
Webrat.configure do |config| | |
config.mode = :rack | |
end | |
class RankerWorld | |
include Rack::Test::Methods | |
include Webrat::Methods | |
include Webrat::Matchers | |
Webrat::Methods.delegate_to_session :response_code, :response_body | |
def app | |
Sinatra::Application | |
end | |
end | |
Before do | |
DataMapper.auto_migrate! | |
end | |
World { RankerWorld.new } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment