Skip to content

Instantly share code, notes, and snippets.

@chadoh
Created June 6, 2011 15:52
Show Gist options
  • Save chadoh/1010512 to your computer and use it in GitHub Desktop.
Save chadoh/1010512 to your computer and use it in GitHub Desktop.
This isn't working. Or something isn't working, anyhow.
# More info at https://github.com/guard/guard#readme
guard 'minitest' do
# with Minitest::Unit
watch(%r{^lib/(.+)\.rb$}) { |m| "test/#{m[1]}_test.rb" }
watch(%r{^test/.+_test\.rb$})
watch('test/test_helper.rb') { "test" }
# Rails example
watch(%r{^app/models/(.+)\.rb$}) { |m| "test/unit/#{m[1]}_test.rb" }
watch(%r{^app/controllers/(.+)\.rb$}) { |m| "test/functional/#{m[1]}_test.rb" }
watch(%r{^app/views/.+\.rb$}) { "test/integration" }
watch('app/controllers/application_controller.rb') { ["test/functional", "test/integration"] }
# with Minitest::Spec
# watch('^spec/(.*)_spec.rb')
# watch('^lib/(.*)\.rb') { |m| "spec/#{m[1]}_spec.rb" }
# watch('^spec/spec_helper.rb') { "spec" }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment