Class: Minitest::Heat::Output::Results

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/minitest/heat/output/results.rb

Overview

Generates the output tokens to display the results summary

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(results, timer) ⇒ Results

Returns a new instance of Results.



14
15
16
17
18
# File 'lib/minitest/heat/output/results.rb', line 14

def initialize(results, timer)
  @results = results
  @timer = timer
  @tokens = []
end

Instance Attribute Details

#resultsObject

Returns the value of attribute results.



10
11
12
# File 'lib/minitest/heat/output/results.rb', line 10

def results
  @results
end

#timerObject

Returns the value of attribute timer.



10
11
12
# File 'lib/minitest/heat/output/results.rb', line 10

def timer
  @timer
end

Instance Method Details

#tokensObject



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/minitest/heat/output/results.rb', line 20

def tokens
  # Only show the issue type counts if there are issues
  @tokens << [*issue_counts_tokens] if issue_counts_tokens&.any?

  @tokens << [
    timing_token, spacer_token,
    test_count_token, tests_performance_token, join_token,
    assertions_count_token, assertions_performance_token
  ]

  @tokens
end