Skip to content

Instantly share code, notes, and snippets.

@dgilperez
Created July 4, 2012 20:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgilperez/3049442 to your computer and use it in GitHub Desktop.
Save dgilperez/3049442 to your computer and use it in GitHub Desktop.
Our Guardfile
guard 'spork', :rspec_env => { 'RAILS_ENV' => 'test' }, :wait => 60, :notify_on_start => true 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(%r{^spec/support/(requests|controllers|mailers|models)_helpers\.rb}) { :rspec }
watch(%r{^spec/acceptance/support/(.*)\.rb}) { :rspec }
watch('config/routes.rb') { :rspec }
watch('test/test_helper.rb') { :test_unit }
end
guard :rspec, :version => 2, :cli => "--color --drb -r rspec/instafail -f RSpec::Instafail", :bundler => false, :all_after_pass => false, :all_on_start => false, :keep_failed => false do
watch('spec/spec_helper.rb') { "spec" }
#watch('config/routes.rb') { "spec/routing" }
#watch('app/controllers/application_controller.rb') { "spec/controllers" }
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| ["spec/acceptance/#{m[1]}_spec.rb", "spec/acceptance/#{m[1]}s_spec.rb"] }
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/acceptance/#{m[1]}_spec.rb", "spec/acceptance/#{m[1]}s_spec.rb"] }
watch(%r{^spec/support/(requests|controllers|mailers|models)_helpers\.rb}) { |m| "spec/#{m[1]}" }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment