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
# Updated for rspec 3.0: | |
module IncludeRecipeHelper | |
def enable_stubbed_include_recipe | |
# Don't worry about external cookbook dependencies | |
allow_any_instance_of(Chef::Cookbook::Metadata).to receive(:depends) | |
# Test each recipe in isolation, regardless of includes | |
@included_recipes = [] | |
allow_any_instance_of(Chef::RunContext).to receive(:loaded_recipe?).and_return(false) | |
allow_any_instance_of(Chef::Recipe).to receive(:include_recipe) do |recipe, included_recipe| |