Skip to content

Instantly share code, notes, and snippets.

@ericfode
Created September 12, 2014 21:05
Show Gist options
  • Save ericfode/ead8699a26ccd6c4b499 to your computer and use it in GitHub Desktop.
Save ericfode/ead8699a26ccd6c4b499 to your computer and use it in GitHub Desktop.
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
#Hygene
guard "foodcritic", :cookbook_paths => ".", :all_on_start => false do
watch(%r{attributes/.+\.rb$})
watch(%r{providers/.+\.rb$})
watch(%r{recipes/.+\.rb$})
watch(%r{resources/.+\.rb$})
watch(%r{^templates/(.+)})
watch('metadata.rb')
end
guard :rspec, cmd: 'bundle exec rspec', :all_on_start => false, notification: false do
watch(%r{^spec/(.+)_spec\.rb$})
#find any files that end with .rb look for a file that starts with the same name but ends with _spec.rb
watch(%r{^(recipes)/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { 'spec' }
end
#Integration tests using serverspec/bats
guard "kitchen" do
watch(%r{test/.+})
watch(%r{^recipes/(.+)\.rb$})
watch(%r{^attributes/(.+)\.rb$})
watch(%r{^files/(.+)})
watch(%r{^providers/(.+)\.rb$})
watch(%r{^resources/(.+)\.rb$})
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment