Class: Turn::Reporter

Inherits:
Object
  • Object
show all
Includes:
Colorize
Defined in:
lib/turn/reporter.rb

Overview

Reporter

There are two distinct way in which a report may be utilized by a Runner: per-call or per-file. The method #pass, #fail and #error are generic, and will be used in either case. A per-call runner will use all the methods of a Reporter, while a per-file runner will use start_case per file, and will not use the start_test and finish_test methods, since those are beyond it’s grainularity.

Constant Summary

Constants included from Colorize

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Colorize

blue, bold, error, fail, green, magenta, pass, red, skip

Constructor Details

#initialize(io) ⇒ Reporter

Returns a new instance of Reporter.



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

def initialize(io)
  @io = io || $stdout
end

Instance Attribute Details

#ioObject (readonly)

Returns the value of attribute io.



19
20
21
# File 'lib/turn/reporter.rb', line 19

def io
  @io
end

Instance Method Details

#error(exception, message = nil) ⇒ Object



42
43
# File 'lib/turn/reporter.rb', line 42

def error(exception, message=nil)
end

#fail(assertion, message = nil) ⇒ Object



39
40
# File 'lib/turn/reporter.rb', line 39

def fail(assertion, message=nil)
end

#finish_case(test_case) ⇒ Object



48
49
# File 'lib/turn/reporter.rb', line 48

def finish_case(test_case)
end

#finish_suite(test_suite) ⇒ Object



51
52
# File 'lib/turn/reporter.rb', line 51

def finish_suite(test_suite)
end

#finish_test(test) ⇒ Object



45
46
# File 'lib/turn/reporter.rb', line 45

def finish_test(test)
end

#pass(message = nil) ⇒ Object



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

def pass(message=nil)
end

#start_case(test_case) ⇒ Object



30
31
# File 'lib/turn/reporter.rb', line 30

def start_case(test_case)
end

#start_suite(test_suite) ⇒ Object

These methods are called in the process of running the tests.



27
28
# File 'lib/turn/reporter.rb', line 27

def start_suite(test_suite)
end

#start_test(test) ⇒ Object



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

def start_test(test)
end