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
#<<, #backtrace, #backtrace_snippets, #backtrace_snippets_chain, #captured_output, #captured_output?, #captured_stderr, #captured_stderr?, #captured_stdout, #captured_stdout?, #clean_backtrace, #code_snippet, #complete_cases, #config, #count_tally, #duration, #exit_code, #finalize, #finish_case, #finish_suite, #finish_test, #format_snippet_array, #handle, inherited, #initialize, #note, #omit, #parse_backtrace, #parse_source_location, #source, #start_test, #tally, #tally_message, #time_tally, #todo
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
|