Class: Turn::DotReporter

Inherits:
Reporter show all
Defined in:
lib/turn/reporters/dot_reporter.rb

Overview

Traditional Dot Reporter

Constant Summary

Constants included from Colorize

Colorize::COLORIZE, Colorize::ERROR, Colorize::FAIL, Colorize::PASS

Instance Attribute Summary

Attributes inherited from Reporter

#io

Instance Method Summary collapse

Methods inherited from Reporter

#initialize

Constructor Details

This class inherits a constructor from Turn::Reporter

Instance Method Details

#error(message = nil) ⇒ Object



29
30
31
# File 'lib/turn/reporters/dot_reporter.rb', line 29

def error(message=nil)
  io.print 'E'; io.flush
end

#fail(message = nil) ⇒ Object



25
26
27
# File 'lib/turn/reporters/dot_reporter.rb', line 25

def fail(message=nil)
  io.print 'F'; io.flush
end

#finish_case(kase) ⇒ Object



36
37
# File 'lib/turn/reporters/dot_reporter.rb', line 36

def finish_case(kase)
end

#finish_suite(suite) ⇒ Object



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/turn/reporters/dot_reporter.rb', line 39

def finish_suite(suite)
  io.puts("\nFinished in %.5f seconds." % [Time.now - @time])
  io.puts

  report = ''

  fails = suite.select do |testrun|
    testrun.fail? || testrun.error?
  end

  unless fails.empty? # or verbose?
    #report << "\n\n-- Failures and Errors --\n\n"
    fails.uniq.each do |testrun|
      message = testrun.message.tabto(0)
      message = ::ANSICode.magenta(message) if COLORIZE
      report << message << "\n"
    end
    report << "\n"
  end

  io.puts report

  io.puts "%s tests, %s assetions, %s failures, %s errors" % test_tally(suite)
end

#finish_test(test) ⇒ Object



33
34
# File 'lib/turn/reporters/dot_reporter.rb', line 33

def finish_test(test)
end

#pass(message = nil) ⇒ Object



21
22
23
# File 'lib/turn/reporters/dot_reporter.rb', line 21

def pass(message=nil)
  io.print '.'; io.flush
end

#start_case(kase) ⇒ Object



15
16
# File 'lib/turn/reporters/dot_reporter.rb', line 15

def start_case(kase)
end

#start_suite(suite) ⇒ Object



9
10
11
12
13
# File 'lib/turn/reporters/dot_reporter.rb', line 9

def start_suite(suite)
  @time = Time.now
  io.puts "Loaded suite #{suite.name}"
  io.puts "Started"
end

#start_test(test) ⇒ Object



18
19
# File 'lib/turn/reporters/dot_reporter.rb', line 18

def start_test(test)
end