Class: Petitest::Texts::TestResultCharacterText
- Defined in:
- lib/petitest/texts/test_result_character_text.rb
Constant Summary
Constants inherited from BaseText
BaseText::ANSI_COLOR_CODE_BY_COLOR_TYPE
Instance Attribute Summary collapse
- #test ⇒ Petitest::Test readonly
Instance Method Summary collapse
-
#initialize(test:) ⇒ TestResultCharacterText
constructor
A new instance of TestResultCharacterText.
- #to_s ⇒ Object
Constructor Details
#initialize(test:) ⇒ TestResultCharacterText
Returns a new instance of TestResultCharacterText.
10 11 12 |
# File 'lib/petitest/texts/test_result_character_text.rb', line 10 def initialize(test:) @test = test end |
Instance Attribute Details
#test ⇒ Petitest::Test (readonly)
7 8 9 |
# File 'lib/petitest/texts/test_result_character_text.rb', line 7 def test @test end |
Instance Method Details
#to_s ⇒ Object
Note:
Override
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/petitest/texts/test_result_character_text.rb', line 15 def to_s case when test.runner.failed? colorize("F", :error) when test.runner.skipped? colorize("*", :skip) else "." end end |