Sha256: 2cf430e07d648c291f767d5590ec198b421b5bed30d76a959666a56c301deb0a

Contents?: true

Size: 633 Bytes

Versions: 4

Compression:

Stored size: 633 Bytes

Contents

require "petitest/texts/base_text"

module Petitest
  module Texts
    class TestCaseResultCharacterText < ::Petitest::Texts::BaseText
      # @return [Petitest::TestCase]
      attr_reader :test_case

      # @param test_case [Petitest::TestCase]
      def initialize(test_case:)
        @test_case = test_case
      end

      # @note Override
      def to_s
        case
        when test_case.aborted?
          colorize("E", :error)
        when test_case.failed?
          colorize("F", :failure)
        when test_case.skipped?
          colorize("*", :skip)
        else
          "."
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
petitest-0.1.3 lib/petitest/texts/test_case_result_character_text.rb
petitest-0.1.2 lib/petitest/texts/test_case_result_character_text.rb
petitest-0.1.1 lib/petitest/texts/test_case_result_character_text.rb
petitest-0.1.0 lib/petitest/texts/test_case_result_character_text.rb