Skip to content

Instantly share code, notes, and snippets.

@mattwynne
Forked from dmeiz/gist:188313
Created September 17, 2009 17:07
Show Gist options
  • Save mattwynne/188594 to your computer and use it in GitHub Desktop.
Save mattwynne/188594 to your computer and use it in GitHub Desktop.
require 'rack/test'
require 'webrat'
require File.expand_path(File.dirname(__FILE__) + '/../../lib/stats')
Webrat.configure do |config|
config.mode = :rack
end
Stats::App.set :environment, 'cucumber'
Stats::App.enable :raise_errors
Stats::App.establish_db_connections
module MyWorld
include Rack::Test::Methods
include Webrat::Methods
include Webrat::Matchers
Webrat::Methods.delegate_to_session :response_code, :response_body
def app
@app ||= Rack::Builder.new do
run Stats::App
end
end
def app_root
File.expand_path(File.dirname(__FILE__) + '/../../')
end
end
World(MyWorld)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment