mirror of
https://github.com/inspec/inspec
synced 2025-02-17 06:28:40 +00:00
Include code description in the output of failed controls
This commit is contained in:
parent
370a4c75b5
commit
e1faebd527
2 changed files with 7 additions and 3 deletions
|
@ -411,7 +411,11 @@ class InspecRspecCli < InspecRspecJson # rubocop:disable Metrics/ClassLength
|
|||
test_color = @colors[test_status]
|
||||
indicator = @indicators[x[:status]]
|
||||
indicator = @indicators['empty'] if indicator.nil?
|
||||
msg = x[:message] || x[:skip_message] || x[:code_desc]
|
||||
if x[:message]
|
||||
msg = x[:code_desc] + "\n" + x[:message]
|
||||
else
|
||||
msg = x[:skip_message] || x[:code_desc]
|
||||
end
|
||||
print_line(
|
||||
color: test_color,
|
||||
indicator: @indicators['small'] + indicator,
|
||||
|
|
|
@ -160,7 +160,7 @@ Test Summary: \e[32m2 successful\e[0m, \e[31m0 failures\e[0m, \e[37m0 skipped\e[
|
|||
out.stdout.force_encoding(Encoding::UTF_8).must_include "✖ tmp-1.0: Create /tmp directory (1 failed)\e[0m"
|
||||
out.stdout.force_encoding(Encoding::UTF_8).must_include "✖ should not be directory"
|
||||
out.stdout.force_encoding(Encoding::UTF_8).must_include "✖ undefined method `should_nota'"
|
||||
out.stdout.force_encoding(Encoding::UTF_8).must_include "✖ expected `File /tmp.directory?` to return false, got true\e[0m"
|
||||
out.stdout.force_encoding(Encoding::UTF_8).must_include "✖ should not be directory\n expected `File /tmp.directory?` to return false, got true\e[0m"
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -171,7 +171,7 @@ Test Summary: \e[32m2 successful\e[0m, \e[31m0 failures\e[0m, \e[37m0 skipped\e[
|
|||
out.stdout.force_encoding(Encoding::UTF_8).must_include "✖ tmp-1.0: Create /tmp directory (1 failed)\e[0m"
|
||||
out.stdout.force_encoding(Encoding::UTF_8).must_include "✖ should not be directory"
|
||||
out.stdout.force_encoding(Encoding::UTF_8).must_include "✖ undefined method `should_nota'"
|
||||
out.stdout.force_encoding(Encoding::UTF_8).must_include "✖ expected `File /tmp.directory?` to return false, got true\e[0m"
|
||||
out.stdout.force_encoding(Encoding::UTF_8).must_include "✖ should not be directory\n expected `File /tmp.directory?` to return false, got true\e[0m"
|
||||
out.stdout.force_encoding(Encoding::UTF_8).must_include "✔ profiled-1: Create /tmp directory (profile d)"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue