Class: Test::Reporters::Tapy

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

Overview

TAP-Y Reporter

Constant Summary collapse

REVISION =
5

Instance Attribute Summary

Attributes inherited from Abstract

#runner

Instance Method Summary collapse

Methods inherited from AbstractHash

#begin_test, #end_case, #end_test, #skip_test

Methods inherited from Abstract

#begin_test, #end_case, #end_test, inherited, registry, #skip_case, #skip_test

Constructor Details

#initialize(runner) ⇒ Tapy

Returns a new instance of Tapy.



12
13
14
15
# File 'lib/rubytest/reporters/tapy.rb', line 12

def initialize(runner)
  require 'json'
  super(runner)
end

Instance Method Details

#begin_case(test_case) ⇒ Object



25
26
27
# File 'lib/rubytest/reporters/tapy.rb', line 25

def begin_case(test_case)
  puts super(test_case).to_yaml
end

#begin_suite(suite) ⇒ Object



18
19
20
21
22
# File 'lib/rubytest/reporters/tapy.rb', line 18

def begin_suite(suite)
  hash = super(suite)
  hash['rev'] = REVISION
  puts hash.to_json
end

#end_suite(suite) ⇒ Object



55
56
57
58
# File 'lib/rubytest/reporters/tapy.rb', line 55

def end_suite(suite)
  puts super(suite).to_yaml
  puts "..."
end

#error(test, exception) ⇒ Object



40
41
42
# File 'lib/rubytest/reporters/tapy.rb', line 40

def error(test, exception)
  puts super(test, exception).to_yaml
end

#fail(test, exception) ⇒ Object



35
36
37
# File 'lib/rubytest/reporters/tapy.rb', line 35

def fail(test, exception)
  puts super(test, exception).to_yaml
end

#omit(test, exception) ⇒ Object



50
51
52
# File 'lib/rubytest/reporters/tapy.rb', line 50

def omit(test, exception)
  puts super(test, exception).to_yaml
end

#pass(test) ⇒ Object

, backtrace=nil)



30
31
32
# File 'lib/rubytest/reporters/tapy.rb', line 30

def pass(test) #, backtrace=nil)
  puts super(test).to_yaml
end

#todo(test, exception) ⇒ Object



45
46
47
# File 'lib/rubytest/reporters/tapy.rb', line 45

def todo(test, exception)
  puts super(test, exception).to_yaml
end