Sha256: 8dc0a16b7d280b8db12d14602ec1267bc637dd7f67ad8123fc12ab9770d18473

Contents?: true

Size: 534 Bytes

Versions: 2

Compression:

Stored size: 534 Bytes

Contents

require "petitest/texts/base_text"

module Petitest
  module Texts
    class TestResultCharacterText < ::Petitest::Texts::BaseText
      # @return [Petitest::Test]
      attr_reader :test

      # @param test [Petitest::Test]
      def initialize(test:)
        @test = test
      end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
petitest-0.3.1 lib/petitest/texts/test_result_character_text.rb
petitest-0.3.0 lib/petitest/texts/test_result_character_text.rb