Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Spork

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

0 notes on commit da07317

Please sign in to comment.
Something went wrong with that request. Please try again.