Skip to content

Instantly share code, notes, and snippets.

@bmabey
Created June 4, 2009 01:09
Show Gist options
  • Save bmabey/123370 to your computer and use it in GitHub Desktop.
Save bmabey/123370 to your computer and use it in GitHub Desktop.

Revisions

  1. bmabey revised this gist Jun 4, 2009. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions env.rb
    Original file line number Diff line number Diff line change
    @@ -15,6 +15,8 @@
    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
    @@ -23,6 +25,4 @@
    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)

    require 'cucumber/rails/rspec'
    end
  2. bmabey revised this gist Jun 4, 2009. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions env.rb
    Original file line number Diff line number Diff line change
    @@ -13,13 +13,13 @@
    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
    end

    Spork.each_run do
    # This code will be run each time you run your specs.
    require 'cucumber' # I needed to add this... We could move this require to Spork if we think it is better there...
    require 'cucumber/rails/world'
    require 'cucumber/formatter/unicode' # Comment out this line if you don't want Cucumber Unicode support
    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)
  3. bmabey created this gist Jun 4, 2009.
    28 changes: 28 additions & 0 deletions env.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    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'
    end

    Spork.each_run do
    # This code will be run each time you run your specs.
    require 'cucumber' # I needed to add this... We could move this require to Spork if we think it is better there...
    require 'cucumber/rails/world'
    require 'cucumber/formatter/unicode' # Comment out this line if you don't want Cucumber Unicode support
    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)

    require 'cucumber/rails/rspec'
    end