Class: TapOut::Reporters::TapReporter
- Inherits:
-
Abstract
- Object
- Abstract
- TapOut::Reporters::TapReporter
show all
- Defined in:
- lib/tapout/reporters/tap_reporter.rb
Overview
Constant Summary
Constants inherited
from Abstract
Abstract::INTERNALS
Instance Method Summary
collapse
Methods inherited from Abstract
#<<, #clean_backtrace, #code_snippet, #complete_cases, #exit_code, #finalize, #finish_case, #finish_suite, #finish_test, #handle, inherited, #initialize, #note, #omit, #parse_source_location, #skip, #source, #start_test, #tally, #tally_message
Instance Method Details
#error(entry) ⇒ Object
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
# File 'lib/tapout/reporters/tap_reporter.rb', line 57
def error(entry)
super(entry)
@i += 1
x = entry['exception']
body = []
body << "ERROR #{x['file']}:#{x['line']}" body << "#{x['class']}: #{x['message']}"
body << ""
body << code_snippet(entry)
body << ""
body = body.join("\n").gsub(/^/, ' # ')
puts "not ok #{@i} - #{entry['label']}"
puts body
end
|
#fail(entry) ⇒ Object
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
# File 'lib/tapout/reporters/tap_reporter.rb', line 38
def fail(entry)
super(entry)
@i += 1
x = entry['exception']
body = []
body << "FAIL #{x['file']}:#{x['line']}" body << "#{x['message']}"
body << code_snippet(entry)
body = body.join("\n").gsub(/^/, ' # ')
puts "not ok #{@i} - #{entry['label']}"
puts body
end
|
#pass(entry) ⇒ Object
28
29
30
31
32
33
34
35
|
# File 'lib/tapout/reporters/tap_reporter.rb', line 28
def pass(entry)
super(entry)
@i += 1
puts "ok #{@i} - #{entry['label']}"
end
|
#start_case(entry) ⇒ Object
18
19
20
|
# File 'lib/tapout/reporters/tap_reporter.rb', line 18
def start_case(entry)
end
|
#start_suite(entry) ⇒ Object
9
10
11
12
13
14
15
|
# File 'lib/tapout/reporters/tap_reporter.rb', line 9
def start_suite(entry)
@start = Time.now
@i = 0
puts "1..#{entry['count']}"
end
|