Skip to content

Instantly share code, notes, and snippets.

@dreamr
Created April 25, 2013 21:03
Show Gist options
  • Save dreamr/5463156 to your computer and use it in GitHub Desktop.
Save dreamr/5463156 to your computer and use it in GitHub Desktop.
guard "minitest", all_on_start: false, rerun: false do
# with Minitest::Spec
watch(%r|^test/(.*)_test\.rb|)
watch(%r|^lib/(.*)([^/]+)\.rb|) { |m| "test/#{m[1]}#{m[2]}_test.rb" }
watch(%r|^test/minitest_helper\.rb|) { "test" }
watch(%r|^test/support/|) { "test" }
# Rails 3.2
watch(%r|^app/controllers/(.*)\.rb|) { |m| "test/controllers/#{m[1]}_test.rb" }
watch(%r|^app/mailers/(.*)\.rb|) { |m| "test/mailers/#{m[1]}_test.rb" }
watch(%r|^app/helpers/(.*)\.rb|) { |m| "test/helpers/#{m[1]}_test.rb" }
watch(%r|^app/models/(.*)\.rb|) { |m| "test/models/#{m[1]}_test.rb" }
end
guard 'bundler' do
watch('Gemfile')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment