Last active
November 15, 2017 15:50
Revisions
-
hartmantis revised this gist
May 3, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ require 'chefspec' module SpecHelper def global_stubs # Don't worry about external cookbook dependencies Chef::Cookbook::Metadata.any_instance.stub(:depends) -
hartmantis revised this gist
May 2, 2013 . 2 changed files with 17 additions and 11 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,11 +0,0 @@ This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ require 'chefspec' module SpecHelpers def global_stubs # Don't worry about external cookbook dependencies Chef::Cookbook::Metadata.any_instance.stub(:depends) # Test each recipe in isolation, regardless of includes @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 end -
hartmantis created this gist
May 2, 2013 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ # Don't worry about external cookbook dependencies Chef::Cookbook::Metadata.any_instance.stub(:depends) # Test each recipe in isolation, regardless of includes @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)