Permalink
Browse files

Guard at the ready -@jamesmartin -@antonymarcano

  • Loading branch information...
1 parent 70b31cf commit a14d976f764a2e9ed8db49f7a371c9c9d7c33683 @antonymarcano antonymarcano committed Apr 2, 2012
View
1 Gemfile
@@ -13,6 +13,7 @@ group :development, :test do
gem 'guard-rspec', '0.5.5'
gem 'cucumber-rails', '1.2.1'
gem 'database_cleaner', '0.7.2'
+ gem 'guard-cucumber', '0.7.5'
end
# Gems used only for assets and not required
View
4 Gemfile.lock
@@ -78,6 +78,9 @@ GEM
guard (1.0.1)
ffi (>= 0.5.0)
thor (~> 0.14.6)
+ guard-cucumber (0.7.5)
+ cucumber (>= 0.10)
+ guard (>= 0.8.3)
guard-rspec (0.5.5)
guard (>= 0.8.4)
guard-spork (0.3.2)
@@ -181,6 +184,7 @@ DEPENDENCIES
database_cleaner (= 0.7.2)
factory_girl_rails (= 1.4.0)
faker (= 1.0.1)
+ guard-cucumber (= 0.7.5)
guard-rspec (= 0.5.5)
guard-spork (= 0.3.2)
jquery-rails (= 2.0.0)
View
39 Guardfile
@@ -3,6 +3,12 @@
require 'active_support/core_ext'
+guard 'cucumber' 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 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAILS_ENV' => 'test' } do
watch('config/application.rb')
watch('config/environment.rb')
@@ -40,4 +46,35 @@ guard 'rspec', :version => 2, :all_after_pass => false, :cli => '--drb' do
watch(%r{^app/views/(.+)/}) do |m|
"spec/requests/#{m[1].singularize}_pages_spec.rb"
end
-end
+end
+
+guard 'rspec', :version => 2 do
+ watch(%r{^spec/.+_spec\.rb$})
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
+ watch('spec/spec_helper.rb') { "spec" }
+
+ # Rails example
+ watch(%r{^spec/.+_spec\.rb$})
+ watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
+ watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
+ watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
+ watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
+ watch('spec/spec_helper.rb') { "spec" }
+ watch('config/routes.rb') { "spec/routing" }
+ watch('app/controllers/application_controller.rb') { "spec/controllers" }
+ # Capybara request specs
+ watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
+end
+
+
+guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAILS_ENV' => 'test' } do
+ watch('config/application.rb')
+ watch('config/environment.rb')
+ watch(%r{^config/environments/.+\.rb$})
+ watch(%r{^config/initializers/.+\.rb$})
+ watch('Gemfile')
+ watch('Gemfile.lock')
+ watch('spec/spec_helper.rb')
+ watch('test/test_helper.rb')
+end
View
0 ...ep_definitions/registering_microposter.rb → ...initions/registering_microposter_steps.rb
File renamed without changes.

0 comments on commit a14d976

Please sign in to comment.