summaryrefslogtreecommitdiff
path: root/spec/unit
diff options
context:
space:
mode:
authorsnehaldwivedi <sdwivedi@msystechnologies.com>2021-06-09 05:52:18 -0700
committerMarc A. Paradise <marc.paradise@gmail.com>2022-05-24 15:25:14 -0400
commitf859ba08cc51f79d34928316d50df8a9b8f7af1f (patch)
tree64c1ed6917bde550b124e9456c03cafb23bcf73a /spec/unit
parenta5e6b4e47c82fc9e741192006b98d0dec237c1fe (diff)
downloadchef-f859ba08cc51f79d34928316d50df8a9b8f7af1f.tar.gz
Knife upload: bad error message when a recipe has a syntax error
Signed-off-by: snehaldwivedi <sdwivedi@msystechnologies.com>
Diffstat (limited to 'spec/unit')
-rw-r--r--spec/unit/cookbook/syntax_check_spec.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/spec/unit/cookbook/syntax_check_spec.rb b/spec/unit/cookbook/syntax_check_spec.rb
index f9e7bc0d25..88f0f102a7 100644
--- a/spec/unit/cookbook/syntax_check_spec.rb
+++ b/spec/unit/cookbook/syntax_check_spec.rb
@@ -159,12 +159,15 @@ describe Chef::Cookbook::SyntaxCheck do
end
describe "and a file has a syntax error" do
+
before do
cookbook_path = File.join(CHEF_SPEC_DATA, "cookbooks", "borken")
syntax_check.cookbook_path.replace(cookbook_path)
end
it "it indicates that a ruby file has a syntax error" do
+ expect(Chef::Log).to receive(:fatal).with("Cookbook file default.rb has a ruby syntax error.")
+ allow(Chef::Log).to receive(:fatal)
expect(syntax_check.validate_ruby_files).to be_falsey
end