Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Guard setup

  • Loading branch information...
commit f6f667347ec7f6824f10ab44bd947cf0e957eedd 1 parent e969f5d
Jean-Michel Garnier 21croissants authored
Showing with 41 additions and 0 deletions.
  1. +2 −0  Gemfile
  2. +11 −0 Gemfile.lock
  3. +28 −0 Guardfile
2  Gemfile
View
@@ -41,5 +41,7 @@ end
group :development do
gem "rails_best_practices"
gem "ripper", :platforms => :mri_18
+ gem 'guard-rspec'
+ gem 'guard-spork'
end
11 Gemfile.lock
View
@@ -80,6 +80,14 @@ GEM
factory_girl (~> 3.1.0)
railties (>= 3.0.0)
ffi (1.0.11)
+ guard (1.0.2)
+ ffi (>= 0.5.0)
+ thor (~> 0.14.6)
+ guard-rspec (0.7.0)
+ guard (>= 0.10.0)
+ guard-spork (0.8.0)
+ guard (>= 0.10.0)
+ spork (>= 0.8.4)
haml (3.1.4)
highline (1.6.11)
hike (1.2.1)
@@ -177,6 +185,7 @@ GEM
simple_form (2.0.1)
actionpack (~> 3.0)
activemodel (~> 3.0)
+ spork (0.9.1)
sprockets (2.0.3)
hike (~> 1.2)
rack (~> 1.0)
@@ -216,6 +225,8 @@ DEPENDENCIES
dragonfly (~> 0.9.10)
execjs
factory_girl_rails
+ guard-rspec
+ guard-spork
haml
jquery-rails
mysql2
28 Guardfile
View
@@ -0,0 +1,28 @@
+# IMPORTANT: place Spork guard before RSpec/Cucumber/Test::Unit guards!
+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') { :rspec }
+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{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
+ watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_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('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
+
+
Please sign in to comment.
Something went wrong with that request. Please try again.