Skip to content

Instantly share code, notes, and snippets.

@pacoguzman
Forked from bmabey/env.rb
Created August 8, 2009 13:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pacoguzman/164418 to your computer and use it in GitHub Desktop.
Save pacoguzman/164418 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'spork'
Spork.prefork do
# Sets up the Rails environment for Cucumber
ENV["RAILS_ENV"] ||= "cucumber"
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
require 'webrat'
Webrat.configure do |config|
config.mode = :rails
end
require 'webrat/core/matchers'
require 'cucumber' # I needed to add this... We could move this require to Spork if we think it is better there...
require 'cucumber/formatter/unicode' # Comment out this line if you don't want Cucumber Unicode support
require 'spec/rails' # I needed to add this as well to avoid the #records error...
require 'cucumber/rails/rspec'
end
Spork.each_run do
# This code will be run each time you run your specs.
require 'cucumber/rails/world'
Cucumber::Rails.use_transactional_fixtures
Cucumber::Rails.bypass_rescue # Comment out this line if you want Rails own error handling
# (e.g. rescue_action_in_public / rescue_responses / rescue_from)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment