Class: Journo::Reporters::DefaultReporter

Inherits:
Journo::Reporter show all
Defined in:
lib/journo/reporters/default_reporter.rb

Overview

A reporter identical to the standard MiniTest reporter.

Based upon Ryan Davis of Seattle.rb's MiniTest (MIT License).

See Also:

Constant Summary

Constants inherited from Journo::Reporter

Journo::Reporter::VERSION

Instance Method Summary collapse

Methods inherited from Journo::Reporter

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

Instance Method Details

#after_suites(suites, type)



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/journo/reporters/default_reporter.rb', line 37

def after_suites(suites, type)
  time = Time.now - runner.start_time
  
  puts
  puts
  puts "Finished #{type}s in %.6fs, %.4f tests/s, %.4f assertions/s." %
    [time, runner.test_count / time, runner.assertion_count / time]
  
  i = 0
  runner.report.each do |suite, tests|
    tests.each do |test, test_runner|
      message = message_for(test_runner)
      if message
        i += 1
        puts "\n%3d) %s" % [i, message]
      end
    end
  end
  
  puts
  
  puts status
end

#before_suites(suites, type)



11
12
13
14
15
# File 'lib/journo/reporters/default_reporter.rb', line 11

def before_suites(suites, type)
  puts
  puts "# Running #{type}s:"
  puts
end

#before_test(suite, test)



17
18
19
# File 'lib/journo/reporters/default_reporter.rb', line 17

def before_test(suite, test)
  print "#{suite}##{method} = " if verbose?
end

#error(suite, test, test_runner)



33
34
35
# File 'lib/journo/reporters/default_reporter.rb', line 33

def error(suite, test, test_runner)
  after_test('E')
end

#failure(suite, test, test_runner)



29
30
31
# File 'lib/journo/reporters/default_reporter.rb', line 29

def failure(suite, test, test_runner)
  after_test('F')
end

#pass(suite, test, test_runner)



21
22
23
# File 'lib/journo/reporters/default_reporter.rb', line 21

def pass(suite, test, test_runner)
  after_test('.')
end

#skip(suite, test, test_runner)



25
26
27
# File 'lib/journo/reporters/default_reporter.rb', line 25

def skip(suite, test, test_runner)
  after_test('S')
end