diff --git a/Gemfile b/Gemfile index 490c4cf94f..c598fbfbc4 100644 --- a/Gemfile +++ b/Gemfile @@ -71,6 +71,7 @@ group :development do gem 'rails-dev-tweaks', '~> 0.6.1' gem 'guard-rspec' gem 'guard-cucumber' + gem 'guard-spork' end group :development, :test do diff --git a/Gemfile.lock b/Gemfile.lock index b270b2dc69..bcd1616308 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -116,6 +116,11 @@ GEM guard-rspec (2.1.0) guard (>= 1.1) rspec (~> 2.11) + guard-spork (1.2.1) + childprocess (>= 0.2.3) + guard (>= 1.1) + spork (>= 0.8.4) + sys-proctable guard-test (0.5.0) guard (>= 1.1.0) test-unit (~> 2.2) @@ -269,6 +274,7 @@ GEM sqlite3 (1.3.6) sqlite3-ruby (1.2.5) structured_warnings (0.1.3) + sys-proctable (0.9.2) test-unit (2.5.2) thor (0.14.6) tilt (1.3.3) @@ -309,6 +315,7 @@ DEPENDENCIES globalize3! guard-cucumber guard-rspec + guard-spork guard-test htmldiff jquery-rails diff --git a/Guardfile b/Guardfile index b7c4f1e6d5..a74ebf3330 100644 --- a/Guardfile +++ b/Guardfile @@ -1,4 +1,18 @@ -guard :rspec do +# :spork guard must come first +guard :spork, :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAILS_ENV' => 'test' } do + watch('config/application.rb') + watch('config/environment.rb') + watch('config/environments/test.rb') + watch(%r{^config/initializers/.+\.rb$}) + watch('Gemfile') + watch('Gemfile.lock') + watch('spec/spec_helper.rb') { :rspec } + watch(%r{^spec/support/.+\.rb$}) { :rspec } + watch('test/test_helper.rb') { :test } + watch(%r{features/support/}) { :cucumber } +end + +guard :rspec, :cli => "--drb" do watch(%r{^spec/.+_spec\.rb$}) watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } watch('spec/spec_helper.rb') { "spec" } @@ -19,13 +33,13 @@ guard :rspec do watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' } end -guard :cucumber do +guard :cucumber do # , :cli => "--drb" do watch(%r{^features/.+\.feature$}) watch(%r{^features/support/.+$}) { 'features' } watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' } end -guard :test do +guard :test, :all_on_start => false, :all_after_pass => false do # , :drb => true do watch(%r{^lib/(.+)\.rb$}) { |m| "test/#{m[1]}_test.rb" } watch(%r{^test/.+_test\.rb$}) watch('test/test_helper.rb') { "test" }