Module: Ace::TestRunner::Suite::DisplayHelpers
- Included in:
- DisplayManager, SimpleDisplayManager
- Defined in:
- lib/ace/test_runner/suite/display_helpers.rb
Overview
DisplayHelpers provides shared formatting methods for display managers. This module centralizes common output formatting logic used by both SimpleDisplayManager (line-by-line) and DisplayManager (animated).
Interface Requirements
Including classes must implement:
color(text, color_name) - Apply color to text (or return text unchanged)
@param text [String] the text to colorize
@param color_name [Symbol] one of :green, :red, :yellow
@return [String] colorized text or plain text
This module provides a ‘colorize` wrapper that delegates to `color()`. Internal methods use `colorize()` for consistency; including classes only need to implement `color()`.
Instance Method Summary collapse
-
#render_summary(summary, start_time, separator) ⇒ Object
Render the overall summary section.
Instance Method Details
#render_summary(summary, start_time, separator) ⇒ Object
Render the overall summary section
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/ace/test_runner/suite/display_helpers.rb', line 27 def render_summary(summary, start_time, separator) puts puts separator total_duration = Time.now - start_time total_skipped = summary[:total_skipped] || 0 # Show packages with skipped tests first (least important, scrolls away) render_skipped_packages(summary, total_skipped) # Show failed packages (important but less than status) render_failed_packages(summary) # Duration puts "Duration: #{sprintf("%.2f", total_duration)}s" # Stats (packages, tests, assertions) puts "Packages: #{summary[:packages_passed]} passed, #{summary[:packages_failed]} failed" render_tests_line(summary, total_skipped) render_assertions_line(summary) # Overall status message LAST (most visible) puts (summary[:packages_failed], total_skipped) puts separator end |