summaryrefslogtreecommitdiff
path: root/spec/unit/recipe_spec.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2013-11-14 19:20:09 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2013-11-14 19:20:09 -0800
commitdbd925b357b036447b47cf5f369792f81d69e76d (patch)
tree31a50b87878057b04b3e75bc1615cd67b228d74c /spec/unit/recipe_spec.rb
parentecbc917ac5496f3138b798332ea66f477c33f8ba (diff)
downloadchef-dbd925b357b036447b47cf5f369792f81d69e76d.tar.gz
CHEF-4777: add include_recipes to recipes node attr
Diffstat (limited to 'spec/unit/recipe_spec.rb')
-rw-r--r--spec/unit/recipe_spec.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/unit/recipe_spec.rb b/spec/unit/recipe_spec.rb
index 4615bcb4d4..16f1743c9c 100644
--- a/spec/unit/recipe_spec.rb
+++ b/spec/unit/recipe_spec.rb
@@ -193,6 +193,7 @@ describe Chef::Recipe do
describe "include_recipe" do
it "should evaluate another recipe with include_recipe" do
+ @node.should_receive(:loaded_recipe).with("openldap::gigantor")
@run_context.include_recipe "openldap::gigantor"
res = @run_context.resource_collection.resources(:cat => "blanket")
res.name.should eql("blanket")
@@ -200,6 +201,7 @@ describe Chef::Recipe do
end
it "should load the default recipe for a cookbook if include_recipe is called without a ::" do
+ @node.should_receive(:loaded_recipe).with("openldap")
@run_context.include_recipe "openldap"
res = @run_context.resource_collection.resources(:cat => "blanket")
res.name.should eql("blanket")
@@ -207,11 +209,13 @@ describe Chef::Recipe do
end
it "should store that it has seen a recipe in the run_context" do
+ @node.should_receive(:loaded_recipe).with("openldap")
@run_context.include_recipe "openldap"
@run_context.loaded_recipe?("openldap").should be_true
end
it "should not include the same recipe twice" do
+ @node.should_receive(:loaded_recipe).with("openldap").exactly(:once)
@cookbook_collection[:openldap].should_receive(:load_recipe).with("default", @run_context)
@recipe.include_recipe "openldap"
@cookbook_collection[:openldap].should_not_receive(:load_recipe).with("default", @run_context)