3
4
5
6
7
8
9
10
11
12
13
14
15
|
# File 'lib/cookbook/development/test/unit/chefspec/helpers/stub_helpers.rb', line 3
def stub_include_recipe
Chef::Cookbook::Metadata.any_instance.stub(:depends)
@included_recipes = []
Chef::RunContext.any_instance.stub(:loaded_recipe?).and_return(false)
Chef::Recipe.any_instance.stub(:include_recipe) do |i|
Chef::RunContext.any_instance.stub(:loaded_recipe?).with(i).and_return(true)
@included_recipes << i
end
Chef::RunContext.any_instance.stub(:loaded_recipes).and_return(@included_recipes)
end
|