Class: MiniTest::Reporters::RubyMateReporter

Inherits:
Object
  • Object
show all
Includes:
MiniTest::Reporter
Defined in:
lib/minitest/reporters/ruby_mate_reporter.rb

Overview

Simple reporter designed for RubyMate.

Constant Summary collapse

INFO_PADDING =
2

Instance Method Summary collapse

Methods included from MiniTest::Reporter

#after_suite, #before_suite, #before_test, #output, #pass, #print, #puts, #runner, #verbose?

Constructor Details

#initialize(backtrace_filter = MiniTest::BacktraceFilter.default_filter) ⇒ RubyMateReporter

Returns a new instance of RubyMateReporter.



12
13
14
# File 'lib/minitest/reporters/ruby_mate_reporter.rb', line 12

def initialize(backtrace_filter = MiniTest::BacktraceFilter.default_filter)
  @backtrace_filter = backtrace_filter
end

Instance Method Details

#after_suites(suites, type)



44
45
46
47
48
49
50
51
52
53
# File 'lib/minitest/reporters/ruby_mate_reporter.rb', line 44

def after_suites(suites, type)
  total_time = Time.now - runner.start_time

  puts
  puts('Finished in %.5fs' % total_time)
  print('%d tests, %d assertions, ' % [runner.test_count, runner.assertion_count])
  print('%d failures, %d errors, ' % [runner.failures, runner.errors])
  print('%d skips' % runner.skips)
  puts
end

#before_suites(suites, type)



16
17
18
19
# File 'lib/minitest/reporters/ruby_mate_reporter.rb', line 16

def before_suites(suites, type)
  puts 'Started'
  puts
end

#error(suite, test, test_runner)



36
37
38
39
40
41
42
# File 'lib/minitest/reporters/ruby_mate_reporter.rb', line 36

def error(suite, test, test_runner)
  print 'ERROR'
  print_test_with_time(suite, test)
  puts
  print_info(test_runner.exception)
  puts
end

#failure(suite, test, test_runner)



28
29
30
31
32
33
34
# File 'lib/minitest/reporters/ruby_mate_reporter.rb', line 28

def failure(suite, test, test_runner)
  print 'FAIL'
  print_test_with_time(suite, test)
  puts
  print_info(test_runner.exception)
  puts
end

#skip(suite, test, test_runner)



21
22
23
24
25
26
# File 'lib/minitest/reporters/ruby_mate_reporter.rb', line 21

def skip(suite, test, test_runner)
  print 'SKIP'
  print_test_with_time(suite, test)
  puts
  puts
end