Created
April 4, 2013 04:00
-
-
Save charlesjohnson/5307717 to your computer and use it in GitHub Desktop.
Fix for apache2 cookbook 1.6.0 broken test library ~/.berkshelf/cookbooks/apache2-1.6.0/files/default/tests/minitest/support/helpers.rb
Line 50
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
#def ran_recipe?(recipe) | |
# node.run_state[:seen_recipes].keys.include?(recipe) | |
#end | |
def ran_recipe?(recipe) | |
if Chef::VERSION < "11.0" | |
seen_recipes = node.run_state[:seen_recipes] | |
recipes = seen_recipes.keys.each { |i| i } | |
else | |
recipes = run_context.loaded_recipes | |
end | |
if recipes.empty? and Chef::Config[:solo] | |
#If you have roles listed in your run list they are NOT expanded | |
recipes = node.run_list.map {|item| item.name if item.type == :recipe } | |
end | |
recipes.include?(recipe) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment