summaryrefslogtreecommitdiff
path: root/lib/chef/formatters
diff options
context:
space:
mode:
authortyler-ball <tyleraball@gmail.com>2014-11-05 11:25:05 -0800
committertyler-ball <tyleraball@gmail.com>2014-12-17 18:47:25 -0800
commit5647ffbafcf22cd54b1edc0b02926aca90b9099c (patch)
treeeca29649eb4ab988796d34aa052903b02007d0f0 /lib/chef/formatters
parent9f3390ffe26abbe54b51aee19a78cf2778b9b340 (diff)
downloadchef-5647ffbafcf22cd54b1edc0b02926aca90b9099c.tar.gz
Adding first round of formatter integration - STDOUT doc formatter
Diffstat (limited to 'lib/chef/formatters')
-rw-r--r--lib/chef/formatters/doc.rb54
1 files changed, 47 insertions, 7 deletions
diff --git a/lib/chef/formatters/doc.rb b/lib/chef/formatters/doc.rb
index 66ee6ccabe..96ca283b9f 100644
--- a/lib/chef/formatters/doc.rb
+++ b/lib/chef/formatters/doc.rb
@@ -156,17 +156,57 @@ class Chef
converge_complete
end
- def audit_start(run_context)
- # TODO read the number of `controls` blocks to run from the run_context.audit_runner
- puts_line "Running collected audits"
+ #############
+ # TODO
+ # Make all these document printers neater
+ #############
+
+ # Called before audit phase starts
+ def audit_phase_start(run_context)
+ puts_line ""
+ puts_line "Audit phase starting"
+ end
+
+ # Called when audit phase successfully finishes
+ def audit_phase_complete
+ puts_line "Audit phase ended"
+ end
+
+ # Called if there is an uncaught exception during the audit phase. The audit runner should
+ # be catching and handling errors from the examples, so this is only uncaught errors (like
+ # bugs in our handling code)
+ def audit_phase_failed(error)
+ puts_line "Audit phase exception:"
+ indent
+ # TODO error_mapper ?
+ puts_line "#{error.message}"
+ error.backtrace.each do |l|
+ puts_line l
+ end
end
- def audit_complete
- # TODO
+ def control_group_start(name)
+ puts_line "Control group #{name} started"
+ indent
end
- def audit_failed(exception)
- # TODO
+ def control_group_end
+ unindent
+ end
+
+ def control_example_success(description)
+ puts_line "SUCCESS - #{description}"
+ end
+
+ def control_example_failure(description, error)
+ puts_line "FAILURE - #{description}"
+ indent
+ # TODO error_mapper ?
+ puts_line "#{error.message}"
+ # error.backtrace.each do |l|
+ # puts_line l
+ # end
+ unindent
end
# Called before action is executed on a resource.