Skip to content

Instantly share code, notes, and snippets.

@cball
Created September 7, 2011 21:48
Show Gist options
  • Save cball/1201885 to your computer and use it in GitHub Desktop.
Save cball/1201885 to your computer and use it in GitHub Desktop.
Spork & Rspec Guardfile
# More info at https://github.com/guard/guard#readme
guard 'spork', :cucumber => false, :test_unit => false, :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('spec/spec_helper.rb')
end
guard 'rspec', :version => 1, :cli => "--color --format progress --drb" do
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{^spec/factories/(.+).rb$}) { "spec" }
watch(%r{^spec/models/.+.rb$}) { "spec/models" }
watch(%r{^spec/routing/.+.rb$}) { "spec/routing" }
watch('spec/spec_helper.rb') { "spec" }
watch('config/routes.rb') { "spec/routing" }
watch('app/controllers/application_controller.rb') { "spec/controllers" }
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment