Permalink
Browse files

Spork

  • Loading branch information...
1 parent b1eec16 commit da07317fe2d7c37ea57cfa33d3fb05b90fdc22b2 Andy Waite committed Apr 9, 2012
Showing with 21 additions and 61 deletions.
  1. +3 −2 Gemfile
  2. +5 −0 Gemfile.lock
  3. +3 −3 config/cucumber.yml
  4. +10 −56 features/support/env.rb
View
@@ -52,7 +52,7 @@ gem 'haml', '~> 3.1.1'
#END:plugins
group :test do
- gem 'cucumber-rails', '~> 1.3.0'
+ gem 'cucumber-rails', '~> 1.3.0', require: false
gem 'rspec', '~> 2.9.0'
gem 'database_cleaner'
gem 'factory_girl_rails', '~> 3.0.0'
@@ -62,4 +62,5 @@ end
group :development do
gem 'launchy'
-end
+ gem 'spork-rails'
+end
View
@@ -162,6 +162,10 @@ GEM
ffi (~> 1.0)
multi_json (~> 1.0)
rubyzip
+ spork (1.0.0rc2)
+ spork-rails (3.2.0)
+ rails (>= 3.0.0, < 3.3.0)
+ spork (>= 1.0rc0)
sprockets (2.1.2)
hike (~> 1.2)
rack (~> 1.0)
@@ -201,6 +205,7 @@ DEPENDENCIES
rake (~> 0.9.2)
rspec (~> 2.9.0)
sass-rails (~> 3.2.3)
+ spork-rails
sqlite3
uglifier (>= 1.0.3)
will_paginate (~> 3.0)
View
@@ -3,6 +3,6 @@ rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip"
%>
-default: <%= std_opts %> features
-wip: --tags @wip:3 --wip features
-rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
+default: --drb <%= std_opts %> features
+wip: --drb --tags @wip:3 --wip features
+rerun: --drb <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
View
@@ -1,61 +1,15 @@
-require 'capybara-page-object'
+require 'spork'
+#uncomment the following line to use spork with the debugger
+#require 'spork/ext/ruby-debug'
-# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
-# It is recommended to regenerate this file in the future when you upgrade to a
-# newer version of cucumber-rails. Consider adding your own code to a new file
-# instead of editing this one. Cucumber will automatically load all features/**/*.rb
-# files.
+Spork.prefork do
+ require 'capybara-page-object'
+ require 'cucumber/rails'
-require 'cucumber/rails'
-
-# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
-# order to ease the transition to Capybara we set the default here. If you'd
-# prefer to use XPath just remove this line and adjust any selectors in your
-# steps to use the XPath syntax.
-Capybara.default_selector = :css
-
-# By default, any exception happening in your Rails application will bubble up
-# to Cucumber so that your scenario will fail. This is a different from how
-# your application behaves in the production environment, where an error page will
-# be rendered instead.
-#
-# Sometimes we want to override this default behaviour and allow Rails to rescue
-# exceptions and display an error page (just like when the app is running in production).
-# Typical scenarios where you want to do this is when you test your error pages.
-# There are two ways to allow Rails to rescue exceptions:
-#
-# 1) Tag your scenario (or feature) with @allow-rescue
-#
-# 2) Set the value below to true. Beware that doing this globally is not
-# recommended as it will mask a lot of errors for you!
-#
-ActionController::Base.allow_rescue = false
-
-# Remove/comment out the lines below if your app doesn't have a database.
-# For some databases (like MongoDB and CouchDB) you may need to use :truncation instead.
-begin
+ Capybara.default_selector = :css
DatabaseCleaner.strategy = :truncation # since I don't think Sqlite supports transactions (TODO check this)
-rescue NameError
- raise "You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it."
+ Cucumber::Rails::Database.javascript_strategy = :truncation
end
-# You may also want to configure DatabaseCleaner to use different strategies for certain features and scenarios.
-# See the DatabaseCleaner documentation for details. Example:
-#
-# Before('@no-txn,@selenium,@culerity,@celerity,@javascript') do
-# # { :except => [:widgets] } may not do what you expect here
-# # as tCucumber::Rails::Database.javascript_strategy overrides
-# # this setting.
-# DatabaseCleaner.strategy = :truncation
-# end
-#
-# Before('~@no-txn', '~@selenium', '~@culerity', '~@celerity', '~@javascript') do
-# DatabaseCleaner.strategy = :transaction
-# end
-#
-
-# Possible values are :truncation and :transaction
-# The :transaction strategy is faster, but might give you threading problems.
-# See https://github.com/cucumber/cucumber-rails/blob/master/features/choose_javascript_database_strategy.feature
-Cucumber::Rails::Database.javascript_strategy = :truncation
-
+Spork.each_run do
+end

0 comments on commit da07317

Please sign in to comment.