summaryrefslogtreecommitdiff
path: root/spec/unit/dsl/recipe_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/dsl/recipe_spec.rb')
-rw-r--r--spec/unit/dsl/recipe_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/unit/dsl/recipe_spec.rb b/spec/unit/dsl/recipe_spec.rb
index cd01079c15..bc97ecc029 100644
--- a/spec/unit/dsl/recipe_spec.rb
+++ b/spec/unit/dsl/recipe_spec.rb
@@ -24,6 +24,11 @@ class RecipeDSLExampleClass
include Chef::DSL::Recipe
end
+FullRecipeDSLExampleClass = Struct.new(:cookbook_name, :recipe_name)
+class FullRecipeDSLExampleClass
+ include Chef::DSL::Recipe::FullDSL
+end
+
RecipeDSLBaseAPI = Struct.new(:cookbook_name, :recipe_name)
class RecipeDSLExampleSubclass < RecipeDSLBaseAPI
include Chef::DSL::Recipe
@@ -36,6 +41,14 @@ describe Chef::DSL::Recipe do
let(:cookbook_name) { "example_cb" }
let(:recipe_name) { "example_recipe" }
+ it "tracks when it is included via FullDSL" do
+ expect(Chef::DSL::Recipe::FullDSL.descendants).to include(FullRecipeDSLExampleClass)
+ end
+
+ it "doesn't track what is included via only the recipe DSL" do
+ expect(Chef::DSL::Recipe::FullDSL.descendants).not_to include(RecipeDSLExampleClass)
+ end
+
shared_examples_for "A Recipe DSL Implementation" do
it "responds to cookbook_name" do