Created
January 2, 2014 20:59
-
-
Save micgo/8226787 to your computer and use it in GitHub Desktop.
Chefspec + Foodcritic + Test-Kitchen + Guard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A sample Guardfile | |
# More info at https://github.com/guard/guard#readme | |
guard 'kitchen' do | |
watch(%r{test/.+}) | |
watch(%r{^recipes/(.+)\.rb$}) | |
watch(%r{^attributes/(.+)\.rb$}) | |
watch(%r{^files/(.+)}) | |
watch(%r{^templates/(.+)}) | |
watch(%r{^providers/(.+)\.rb}) | |
watch(%r{^resources/(.+)\.rb}) | |
end | |
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('metadata.rb') | |
end | |
guard :rspec, cmd: 'bundle exec rspec', :all_on_start => false, notification: false do | |
watch(%r{^spec/(.+)_spec\.rb$}) | |
watch(%r{^(recipes)/(.+)\.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
Your watch for rspec recipes (line 24) uses the wrong capture group in the spec file. Could use a non-capturing group to fix: