Skip to content

Instantly share code, notes, and snippets.

@alanmaciel
Created October 31, 2012 21:24
Show Gist options
  • Save alanmaciel/3989960 to your computer and use it in GitHub Desktop.
Save alanmaciel/3989960 to your computer and use it in GitHub Desktop.
Additions to the default Guardfile.
require 'active_support/core_ext'
# Ensures that Guard doesn’t run all the tests after a failing test passes
# (to speed up the Red- Green-Refactor cycle):
guard 'rspec', :version => 2, :all_after_pass => false do
.
.
.
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) do |m|
["spec/routing/#{m[1]}_routing_spec.rb",
"spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb",
"spec/acceptance/#{m[1]}_spec.rb",
(m[1][/_pages/] ? "spec/requests/#{m[1]}_spec.rb" :
"spec/requests/#{m[1].singularize}_pages_spec.rb")]
end
watch(%r{^app/views/(.+)/}) do |m|
(m[1][/_pages/] ? "spec/requests/#{m[1]}_spec.rb" :
"spec/requests/#{m[1].singularize}_pages_spec.rb")
end
.
.
.
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment