summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2019-05-03 17:05:37 -0700
committerGitHub <noreply@github.com>2019-05-03 17:05:37 -0700
commit57a978c2a90c94f42f408370c471612270ed3cc3 (patch)
treeb397da8bbc76575a83b8ae93d36a3befba0ebd4f /spec
parent58db2c3f47e86d539d21f9365adb135726719e38 (diff)
parent1a94e1bc43aed773ef7584ea6c88af80cc884520 (diff)
downloadchef-57a978c2a90c94f42f408370c471612270ed3cc3.tar.gz
Merge pull request #8456 from chef/lcg/parse-only-rb-files
Chef-15: cookbook compiler should parse only .rb files
Diffstat (limited to 'spec')
-rw-r--r--spec/data/run_context/cookbooks/dependency1/attributes/unparsed_file1
-rw-r--r--spec/data/run_context/cookbooks/dependency1/definitions/unparsed_file1
-rw-r--r--spec/data/run_context/cookbooks/dependency1/libraries/unparsed_file1
-rw-r--r--spec/data/run_context/cookbooks/dependency1/providers/unparsed_file1
-rw-r--r--spec/data/run_context/cookbooks/dependency1/recipes/unparsed_file1
-rw-r--r--spec/data/run_context/cookbooks/dependency1/resources/unparsed_file1
-rw-r--r--spec/unit/run_context/cookbook_compiler_spec.rb10
7 files changed, 15 insertions, 1 deletions
diff --git a/spec/data/run_context/cookbooks/dependency1/attributes/unparsed_file b/spec/data/run_context/cookbooks/dependency1/attributes/unparsed_file
new file mode 100644
index 0000000000..60fee07cc6
--- /dev/null
+++ b/spec/data/run_context/cookbooks/dependency1/attributes/unparsed_file
@@ -0,0 +1 @@
+raise "this should not be parsed by the loader"
diff --git a/spec/data/run_context/cookbooks/dependency1/definitions/unparsed_file b/spec/data/run_context/cookbooks/dependency1/definitions/unparsed_file
new file mode 100644
index 0000000000..60fee07cc6
--- /dev/null
+++ b/spec/data/run_context/cookbooks/dependency1/definitions/unparsed_file
@@ -0,0 +1 @@
+raise "this should not be parsed by the loader"
diff --git a/spec/data/run_context/cookbooks/dependency1/libraries/unparsed_file b/spec/data/run_context/cookbooks/dependency1/libraries/unparsed_file
new file mode 100644
index 0000000000..60fee07cc6
--- /dev/null
+++ b/spec/data/run_context/cookbooks/dependency1/libraries/unparsed_file
@@ -0,0 +1 @@
+raise "this should not be parsed by the loader"
diff --git a/spec/data/run_context/cookbooks/dependency1/providers/unparsed_file b/spec/data/run_context/cookbooks/dependency1/providers/unparsed_file
new file mode 100644
index 0000000000..60fee07cc6
--- /dev/null
+++ b/spec/data/run_context/cookbooks/dependency1/providers/unparsed_file
@@ -0,0 +1 @@
+raise "this should not be parsed by the loader"
diff --git a/spec/data/run_context/cookbooks/dependency1/recipes/unparsed_file b/spec/data/run_context/cookbooks/dependency1/recipes/unparsed_file
new file mode 100644
index 0000000000..60fee07cc6
--- /dev/null
+++ b/spec/data/run_context/cookbooks/dependency1/recipes/unparsed_file
@@ -0,0 +1 @@
+raise "this should not be parsed by the loader"
diff --git a/spec/data/run_context/cookbooks/dependency1/resources/unparsed_file b/spec/data/run_context/cookbooks/dependency1/resources/unparsed_file
new file mode 100644
index 0000000000..60fee07cc6
--- /dev/null
+++ b/spec/data/run_context/cookbooks/dependency1/resources/unparsed_file
@@ -0,0 +1 @@
+raise "this should not be parsed by the loader"
diff --git a/spec/unit/run_context/cookbook_compiler_spec.rb b/spec/unit/run_context/cookbook_compiler_spec.rb
index c3a4c1b98f..3c585cf444 100644
--- a/spec/unit/run_context/cookbook_compiler_spec.rb
+++ b/spec/unit/run_context/cookbook_compiler_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Daniel DeLeo (<dan@chef.io>)
-# Copyright:: Copyright 2012-2018, Chef Software Inc.
+# Copyright:: Copyright 2012-2019, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -51,6 +51,14 @@ describe Chef::RunContext::CookbookCompiler do
Chef::RunContext::CookbookCompiler.new(run_context, run_list_expansion, events)
end
+ describe "loading a cookbook fully" do
+ it "does not error" do
+ run_context.instance_variable_set(:@cookbook_compiler, compiler)
+ node.run_list("dependency1::default")
+ compiler.compile
+ end
+ end
+
describe "loading attribute files" do
# Attribute files in the fixture data will append their