Permalink
Browse files

Added guard for spork + rspec.

  • Loading branch information...
rubiety committed Feb 24, 2012
1 parent 6f81cd8 commit 706515ea20fc1fc43483a81b585ace2ff3def674
Showing with 46 additions and 0 deletions.
  1. +5 −0 Gemfile
  2. +11 −0 Gemfile.lock
  3. +30 −0 Guardfile
View
@@ -43,3 +43,8 @@ group :test do
gem "spork", "~> 1.0rc"
end
+group :development, :test do
+ gem "guard"
+ gem "guard-spork"
+ gem "guard-rspec"
+end
View
@@ -73,6 +73,14 @@ GEM
RedCloth (~> 4.2)
actionpack (~> 3.0)
bluecloth (~> 2.0)
+ guard (1.0.0)
+ ffi (>= 0.5.0)
+ thor (~> 0.14.6)
+ guard-rspec (0.6.0)
+ guard (>= 0.10.0)
+ guard-spork (0.5.2)
+ guard (>= 0.10.0)
+ spork (>= 0.8.4)
haml (3.1.4)
hike (1.2.1)
hpricot (0.8.5)
@@ -197,6 +205,9 @@ DEPENDENCIES
factory_girl_rails
faker
formatize
+ guard
+ guard-rspec
+ guard-spork
haml
hpricot
jquery-rails
View
@@ -0,0 +1,30 @@
+# A sample Guardfile
+# More info at https://github.com/guard/guard#readme
+
+guard 'spork', :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 }
+ watch('test/test_helper.rb') { :test_unit }
+ watch(%r{features/support/}) { :cucumber }
+end
+
+guard 'rspec', :version => 2, :cli => "--color --format nested --fail-fast --drb" 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/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
+ watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
+ watch('app/controllers/application_controller.rb') { "spec/controllers" }
+
+ # Capybara request specs
+ watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/acceptance/#{m[1]}_spec.rb" }
+end

0 comments on commit 706515e

Please sign in to comment.