Sha256: 03c2587099decdc6cde2895b67aa39c327d22bf5c5d650050d0380c809f447f2

Contents?: true

Size: 1.23 KB

Versions: 8

Compression:

Stored size: 1.23 KB

Contents

module Minitest
  module Reporters
    # Turn-like reporter that reads like a spec.
    #
    # Based upon TwP's turn (MIT License) and paydro's monkey-patch.
    #
    # @see https://github.com/TwP/turn turn
    # @see https://gist.github.com/356945 paydro's monkey-patch
    class SpecReporter < BaseReporter
      include ANSI::Code
      include RelativePosition

      def start
        super
        puts('Started with run options %s' % options[:args])
        puts
      end

      def report
        super
        puts('Finished in %.5fs' % total_time)
        print('%d tests, %d assertions, ' % [count, assertions])
        color = failures.zero? && errors.zero? ? :green : :red
        print(send(color) { '%d failures, %d errors, ' } % [failures, errors])
        print(yellow { '%d skips' } % skips)
        puts
      end

      def record(test)
        super
        print pad_test(test.name)
        print_colored_status(test)
        print(" (%.2fs)" % test.time)
        puts
        if !test.skipped? && test.failure
          print_info(test.failure)
          puts
        end
      end

      protected

      def before_suite(suite)
        puts suite
      end

      def after_suite(suite)
        puts
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
minitest-reporters-1.0.16 lib/minitest/reporters/spec_reporter.rb
minitest-reporters-1.0.15 lib/minitest/reporters/spec_reporter.rb
minitest-reporters-1.0.14 lib/minitest/reporters/spec_reporter.rb
minitest-reporters-1.0.13 lib/minitest/reporters/spec_reporter.rb
minitest-reporters-1.0.12 lib/minitest/reporters/spec_reporter.rb
minitest-reporters-1.0.11 lib/minitest/reporters/spec_reporter.rb
minitest-reporters-1.0.10 lib/minitest/reporters/spec_reporter.rb
minitest-reporters-1.0.9 lib/minitest/reporters/spec_reporter.rb