summaryrefslogtreecommitdiff
path: root/spec/unit
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2019-05-03 12:35:02 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2019-05-03 12:37:14 -0700
commit1a94e1bc43aed773ef7584ea6c88af80cc884520 (patch)
treefb321770c271528e1aa750324d1f987cf72763bf /spec/unit
parent1c0a097bd1f9f55d4db199b0681afd68f52c218e (diff)
downloadchef-1a94e1bc43aed773ef7584ea6c88af80cc884520.tar.gz
Chef-15: cookbook compiler should parse only .rb fileslcg/parse-only-rb-files
Fixes #6281 which is a frequently reported issue where md files and swap files and other junk causes the cookbook compiler to barf. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/unit')
-rw-r--r--spec/unit/run_context/cookbook_compiler_spec.rb10
1 files changed, 9 insertions, 1 deletions
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