Sha256: 374a2a9af343481174a2a4c685ac896b36e001b21831977db77787047daaf365

Contents?: true

Size: 464 Bytes

Versions: 5

Compression:

Stored size: 464 Bytes

Contents

require "petitest/texts/base_text"

module Petitest
  module Texts
    class ErrorMessageText < ::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
        colorize("#{test_case.error_class_name}: #{test_case.error_message}", :error)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

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