Sha256: a246722db27a82e4d1103696e915d99ada51fcf17b3e0d47cbed6b96bda3d0c8

Contents?: true

Size: 641 Bytes

Versions: 1

Compression:

Stored size: 641 Bytes

Contents

require "minitest"

module Minitest
  module Flog
    class Reporter < Minitest::Reporter
      attr_accessor  :failed_flogs

      def initialize(io = $stdout, options = {})
        super
        self.failed_flogs = []
      end

      def record(result)
        if result.is_a?(Minitest::Flog::Test) && result.failure
          self.failed_flogs << result
        end
      end

      def report
        return unless self.options[:flog] && self.failed_flogs.any?

        result = "\nFlog reporting"
        failed_flogs.each do |f|
          result << f.detail_report
        end
        self.io.print result
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
minitest-flog-0.1.0 lib/minitest/flog/reporter.rb