Skip to content

Instantly share code, notes, and snippets.

@jmgarnier
Created June 2, 2009 14:30
Show Gist options
  • Save jmgarnier/122259 to your computer and use it in GitHub Desktop.
Save jmgarnier/122259 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'spork'
# Sets up the Rails environment for Cucumber
Spork.prefork do
ENV["RAILS_ENV"] ||= "test"
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
end
Spork.each_run do
require 'cucumber/world'
require 'cucumber/rails/world'
require File.expand_path(File.dirname(__FILE__) + '/patched_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)
$KCODE='u' # for UTF-8 ??? => DOES NOT WORK!!! Warning: $KCODE is NONE.
require 'webrat'
Webrat.configure do |config|
config.mode = :rails
config.open_error_files = true # if you are annoyed by firefox opening too many files, change it to "false"
end
require 'cucumber/rails/rspec'
require 'webrat/core/matchers'
require 'machinist'
require File.expand_path(File.dirname(__FILE__) + "/../../spec/test_data_builder")
include TestDataBuilder
# prevent error Mysql::Error: MySQL server has gone away
ActiveRecord::Base.establish_connection # make sure that the db connection is ready.
end
script/cucumber features/_balloon_day/a_register_campaign.feature --drb
/Library/Ruby/Gems/1.8/gems/cucumber-0.3.9.3/lib/cucumber/rails/world.rb:97: undefined method `World' for main:Object (NoMethodError)
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from /Users/jeanmichel/Projects/betterplace/trunk/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:496:in `require'
from /Users/jeanmichel/Projects/betterplace/trunk/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:342:in `new_constants_in'
from /Users/jeanmichel/Projects/betterplace/trunk/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:496:in `require'
from /Users/jeanmichel/Projects/betterplace/trunk/features/support/env.rb:18
from /Library/Ruby/Gems/1.8/gems/bmabey-spork-0.4.4/bin/../lib/spork.rb:15:in `each_run'
from /Users/jeanmichel/Projects/betterplace/trunk/features/support/env.rb:15
... 25 levels...
from /Library/Ruby/Gems/1.8/gems/bmabey-spork-0.4.4/bin/../lib/spork/runner.rb:9:in `run'
from /Library/Ruby/Gems/1.8/gems/bmabey-spork-0.4.4/bin/spork:11
from /usr/bin/spork:19:in `load'
from /usr/bin/spork:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment