Class: Ace::TestRunner::Suite::SimpleDisplayManager

Inherits:
Object
  • Object
show all
Includes:
DisplayHelpers
Defined in:
lib/ace/test_runner/suite/simple_display_manager.rb

Overview

SimpleDisplayManager provides line-by-line output without ANSI cursor control. This is the default display mode, optimized for piping and agent consumption.

Unlike DisplayManager which uses ANSI escape codes to update lines in place, SimpleDisplayManager simply prints one line per package as it completes.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DisplayHelpers

#render_summary

Constructor Details

#initialize(packages, config) ⇒ SimpleDisplayManager

Returns a new instance of SimpleDisplayManager.



18
19
20
21
22
23
24
25
# File 'lib/ace/test_runner/suite/simple_display_manager.rb', line 18

def initialize(packages, config)
  @packages = packages
  @config = config
  @package_status = {}
  @start_time = Time.now
  @use_color = config.dig("test_suite", "display", "color") != false
  @package_width = calculate_package_width
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



16
17
18
# File 'lib/ace/test_runner/suite/simple_display_manager.rb', line 16

def config
  @config
end

#packagesObject (readonly)

Returns the value of attribute packages.



16
17
18
# File 'lib/ace/test_runner/suite/simple_display_manager.rb', line 16

def packages
  @packages
end

#start_timeObject (readonly)

Returns the value of attribute start_time.



16
17
18
# File 'lib/ace/test_runner/suite/simple_display_manager.rb', line 16

def start_time
  @start_time
end

Instance Method Details

#initialize_displayObject

Print initial message showing how many packages will run



28
29
30
# File 'lib/ace/test_runner/suite/simple_display_manager.rb', line 28

def initialize_display
  puts "Running tests for #{@packages.size} packages..."
end

#refreshObject

No-op for simple mode - we don’t need live updates



43
44
45
# File 'lib/ace/test_runner/suite/simple_display_manager.rb', line 43

def refresh
  # Intentionally empty - simple mode doesn't refresh
end

#show_final_resultsObject

No-op for simple mode - results already printed as packages complete



48
49
50
# File 'lib/ace/test_runner/suite/simple_display_manager.rb', line 48

def show_final_results
  # Intentionally empty - completion lines already printed in update_package
end

#show_summary(summary) ⇒ Object

Display the summary section using shared helpers



53
54
55
# File 'lib/ace/test_runner/suite/simple_display_manager.rb', line 53

def show_summary(summary)
  render_summary(summary, @start_time, separator)
end

#update_package(package, status, _output = nil) ⇒ Object

Called when a package status changes. Prints a line when package completes.



33
34
35
36
37
38
39
40
# File 'lib/ace/test_runner/suite/simple_display_manager.rb', line 33

def update_package(package, status, _output = nil)
  @package_status[package["name"]] = status

  # Only print when package completes
  return unless status[:completed]

  print_completion_line(package, status)
end