summaryrefslogtreecommitdiff
path: root/spec/unit/formatters
diff options
context:
space:
mode:
authordanielsdeleo <dan@getchef.com>2015-05-19 15:56:25 -0700
committerdanielsdeleo <dan@getchef.com>2015-05-20 10:42:28 -0700
commit6606220b11fb6de247cf1335f681ba8080c79c79 (patch)
treed654f6c7ef89acf7ed477cb1c8c687abd05b00f4 /spec/unit/formatters
parenta0fad76df616ccc662f3eb660f8d74a96f2a72a4 (diff)
downloadchef-6606220b11fb6de247cf1335f681ba8080c79c79.tar.gz
Show cookbook trace when available regardless of exception type
Diffstat (limited to 'spec/unit/formatters')
-rw-r--r--spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb b/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb
index d957a97284..5f95beb259 100644
--- a/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb
+++ b/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb
@@ -96,6 +96,10 @@ describe Chef::Formatters::ErrorInspectors::CompileErrorInspector do
inspector.add_explanation(description)
end
+ it "reports the error was not located within cookbooks" do
+ expect(inspector.found_error_in_cookbooks?).to be(true)
+ end
+
it "finds the line number of the error from the stacktrace" do
expect(inspector.culprit_line).to eq(14)
end
@@ -138,6 +142,10 @@ describe Chef::Formatters::ErrorInspectors::CompileErrorInspector do
expect { description.display(outputter) }.to_not raise_error
end
+ it "reports the error was not located within cookbooks" do
+ expect(inspector.found_error_in_cookbooks?).to be(false)
+ end
+
end
end
@@ -184,6 +192,10 @@ describe Chef::Formatters::ErrorInspectors::CompileErrorInspector do
let(:full_path_to_failed_file) { "C:/opscode/chef#{path_to_failed_file}" }
+ it "reports the error was not located within cookbooks" do
+ expect(inspector.found_error_in_cookbooks?).to be(true)
+ end
+
it "finds the culprit recipe name" do
expect(inspector.culprit_file).to eq("C:/opscode/chef/var/cache/cookbooks/foo/recipes/default.rb")
end
@@ -205,6 +217,10 @@ describe Chef::Formatters::ErrorInspectors::CompileErrorInspector do
let(:full_path_to_failed_file) { "c:/opscode/chef#{path_to_failed_file}" }
+ it "reports the error was not located within cookbooks" do
+ expect(inspector.found_error_in_cookbooks?).to be(true)
+ end
+
it "finds the culprit recipe name from the stacktrace" do
expect(inspector.culprit_file).to eq("c:/opscode/chef/var/cache/cookbooks/foo/recipes/default.rb")
end