Skip to content

Instantly share code, notes, and snippets.

@robholland
Created August 4, 2009 12:41
Show Gist options
  • Save robholland/161187 to your computer and use it in GitHub Desktop.
Save robholland/161187 to your computer and use it in GitHub Desktop.
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