Class: Test::Reporters::Tapy

Inherits:
AbstractHash show all
Defined in:
lib/rubytest/format/tapy.rb

Overview

TAP-Y Reporter

Writes the run as a TAP-Y stream (revision 5): a YAML document for the suite, each case, each test and the final tally.

Constant Summary collapse

REVISION =
5

Instance Attribute Summary

Attributes inherited from Abstract

#runner

Instance Method Summary collapse

Methods inherited from AbstractHash

#begin_test, #capture_output?, #end_case, #end_test, #finish, #record

Methods inherited from Abstract

#begin_test, #end_case, #end_test, inherited, registry

Constructor Details

#initialize(runner, output: $stdout) ⇒ Tapy

Returns a new instance of Tapy.



15
16
17
18
19
# File 'lib/rubytest/format/tapy.rb', line 15

def initialize(runner, output: $stdout)
  require 'yaml'
  super(runner)
  @output = output
end

Instance Method Details

#begin_case(test_case) ⇒ Object



27
28
29
# File 'lib/rubytest/format/tapy.rb', line 27

def begin_case(test_case)
  emit super(test_case)
end

#begin_suite(suite) ⇒ Object



22
23
24
# File 'lib/rubytest/format/tapy.rb', line 22

def begin_suite(suite)
  emit super(suite).merge('rev' => REVISION)
end

#end_suite(suite) ⇒ Object



62
63
64
65
# File 'lib/rubytest/format/tapy.rb', line 62

def end_suite(suite)
  emit super(suite)
  @output.puts '...'
end

#error(test, exception) ⇒ Object



42
43
44
# File 'lib/rubytest/format/tapy.rb', line 42

def error(test, exception)
  emit super(test, exception)
end

#fail(test, exception) ⇒ Object



37
38
39
# File 'lib/rubytest/format/tapy.rb', line 37

def fail(test, exception)
  emit super(test, exception)
end

#pass(test) ⇒ Object



32
33
34
# File 'lib/rubytest/format/tapy.rb', line 32

def pass(test)
  emit super(test)
end

#skip_case(test_case, reason = nil) ⇒ Object



57
58
59
# File 'lib/rubytest/format/tapy.rb', line 57

def skip_case(test_case, reason=nil)
  emit super(test_case, reason)
end

#skip_test(test, reason = nil) ⇒ Object



52
53
54
# File 'lib/rubytest/format/tapy.rb', line 52

def skip_test(test, reason=nil)
  emit super(test, reason)
end

#todo(test, exception) ⇒ Object



47
48
49
# File 'lib/rubytest/format/tapy.rb', line 47

def todo(test, exception)
  emit super(test, exception)
end