class Cucumber::Formatter::GlobalHooksSummary
AllHookSummary formatter, keep track of failures in Before/AfterAll hooks
Public Class Methods
Source
# File lib/cucumber/formatter/global_hooks_summary.rb, line 16 def initialize(config) @config = config @all_hook_failures = [] @config.on_event :test_run_hook_finished do |event| @all_hook_failures << event unless event.test_result.ok? end end
Public Instance Methods
Source
# File lib/cucumber/formatter/global_hooks_summary.rb, line 29 def exception_listing [format_string('Global hook failures:', :failed)] + @all_hook_failures.map do |event| format_string("#{event.hook.location} # #{event.test_result.exception} (#{event.test_result.exception.class})", :failed) end end
Source
# File lib/cucumber/formatter/global_hooks_summary.rb, line 25 def ok? @all_hook_failures.empty? end