Class: Petitest::Texts::TestsResultText

Inherits:
BaseText
  • Object
show all
Defined in:
lib/petitest/texts/tests_result_text.rb

Constant Summary

Constants inherited from BaseText

BaseText::ANSI_COLOR_CODE_BY_COLOR_TYPE

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(finished_at:, started_at:, tests:) ⇒ TestsResultText

Returns a new instance of TestsResultText.

Parameters:



18
19
20
21
22
23
24
25
26
# File 'lib/petitest/texts/tests_result_text.rb', line 18

def initialize(
  finished_at:,
  started_at:,
  tests:
)
  @finished_at = finished_at
  @started_at = started_at
  @tests = tests
end

Instance Attribute Details

#finished_atTime (readonly)

Returns:

  • (Time)


7
8
9
# File 'lib/petitest/texts/tests_result_text.rb', line 7

def finished_at
  @finished_at
end

#started_atTime (readonly)

Returns:

  • (Time)


10
11
12
# File 'lib/petitest/texts/tests_result_text.rb', line 10

def started_at
  @started_at
end

#testsArray<Petitest::Test> (readonly)

Returns:



13
14
15
# File 'lib/petitest/texts/tests_result_text.rb', line 13

def tests
  @tests
end

Instance Method Details

#to_sObject

Note:

Override



29
30
31
32
33
34
# File 'lib/petitest/texts/tests_result_text.rb', line 29

def to_s
  [
    header,
    body,
  ].join
end