You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tom Wilson edited this page Mar 11, 2015
·
3 revisions
rspec-autotest works well with chefspec. Changing a recipe spec, e.g. spec/recipes/my_recipe.rb runs the spec. However, changing the recipe itself doesn't automatically kick off the spec.
Assuming a single-cookbook repo with directory structure:
# fire recipe spec on recipe changes
Autotest.add_hook :initialize do |at|
at.add_mapping(%r{\Arecipes/(.*)\.rb\z}) { |_, m|
["spec/recipes/#{m[1]}_spec.rb"]
}
end
(No docs found for modifying the .autotest file or for add_hook method. Please add ref's if you know.)