Class: Test::Reporters::Tap
Overview
Classic TAP Reporter
This reporter conforms to v12 of TAP. It could do with some imporvements yet, and eventually upgraded to v13 of standard.
Instance Attribute Summary
Attributes inherited from Abstract
#runner
Instance Method Summary
collapse
Methods inherited from Abstract
#begin_case, #clean_backtrace, #code, #end_case, #end_suite, #end_test, #file, #file_and_line, #file_and_line_array, inherited, #initialize, #line, #record, registry, #skip_case, #skip_test, #subtotal, #tally, #timestamp, #total, #total_count
Instance Method Details
#begin_suite(suite) ⇒ Object
12
13
14
15
16
17
|
# File 'lib/test/reporters/tap.rb', line 12
def begin_suite(suite)
@start_time = Time.now
@i = 0
@n = total_count(suite)
puts "1..#{@n}"
end
|
#begin_test(test) ⇒ Object
19
20
21
|
# File 'lib/test/reporters/tap.rb', line 19
def begin_test(test)
@i += 1
end
|
#error(test, exception) ⇒ Object
37
38
39
40
41
42
|
# File 'lib/test/reporters/tap.rb', line 37
def error(test, exception)
puts "not ok #{@i} - #{test}"
puts " ERROR #{exception.class}"
puts " #{exception}"
puts " " + clean_backtrace(exception).join("\n ")
end
|
#fail(test, exception) ⇒ Object
29
30
31
32
33
34
|
# File 'lib/test/reporters/tap.rb', line 29
def fail(test, exception)
puts "not ok #{@i} - #{test}"
puts " FAIL #{exception.class}"
puts " #{exception}"
puts " #{clean_backtrace(exception)[0]}"
end
|
#omit(test, exception) ⇒ Object
52
53
54
55
56
|
# File 'lib/test/reporters/tap.rb', line 52
def omit(test, exception)
puts "ok #{@i} - #{test}"
puts " OMIT"
puts " #{clean_backtrace(exception)[1]}"
end
|
#pass(test) ⇒ Object
24
25
26
|
# File 'lib/test/reporters/tap.rb', line 24
def pass(test)
puts "ok #{@i} - #{test}"
end
|
#todo(test, exception) ⇒ Object
45
46
47
48
49
|
# File 'lib/test/reporters/tap.rb', line 45
def todo(test, exception)
puts "not ok #{@i} - #{test}"
puts " PENDING"
puts " #{clean_backtrace(exception)[1]}"
end
|