Skip to content

Instantly share code, notes, and snippets.

@oriolgual
Created July 21, 2011 12:18
Show Gist options
  • Save oriolgual/1097075 to your computer and use it in GitHub Desktop.
Save oriolgual/1097075 to your computer and use it in GitHub Desktop.
Example Guardfile with annotate, cucumber, minitest and auto-migrate test database
guard 'annotate', notify: false do
watch( 'db/schema.rb' )
end
guard 'cucumber', cli: '--format progress --no-profile', all_on_start: false do
watch(%r{features/.+\.feature})
watch(%r{features/step_definitions/(.+)_steps\.rb}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] }
end
guard 'minitest', drb: false do
watch(%r{app/(.+)/(.+)\.rb}) { |m| "test/#{m[1]}/#{m[2]}_test.rb" }
watch(%r{test/(.+)/(.+)_test\.rb})
watch(%r{test/test_helper.rb}) { "test" }
end
guard 'shell' do
watch('db/schema.rb') { `rake test:prepare` }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment