Skip to content

Instantly share code, notes, and snippets.

@acwright
Created February 14, 2012 18:32
Show Gist options
  • Select an option

  • Save acwright/1828888 to your computer and use it in GitHub Desktop.

Select an option

Save acwright/1828888 to your computer and use it in GitHub Desktop.
Sinatra Cucumber setup with Capybara, RSpec and MongoMapper
ENV['RACK_ENV'] = 'test'
require File.join(File.dirname(__FILE__), '../../app.rb')
require 'capybara'
require 'capybara/dsl'
require 'rspec/expectations'
require 'rack/test'
require 'uuid'
MongoMapper.database.collections.select { |c| c.name != 'system.indexes' }.each(&:drop)
class MyWorld
include Rack::Test::Methods
def app
App
end
end
World{MyWorld.new}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment