Class: Test::Reporters::Tapj

Inherits:
AbstractHash
  • Object
show all
Defined in:
lib/rubytest/format/tapj.rb

Overview

TAP-J Reporter

Constant Summary collapse

REVISION =
5

Instance Method Summary collapse

Constructor Details

#initialize(runner) ⇒ Tapj

Returns a new instance of Tapj.



12
13
14
15
# File 'lib/rubytest/format/tapj.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/format/tapj.rb', line 25

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

#begin_suite(suite) ⇒ Object



18
19
20
21
22
# File 'lib/rubytest/format/tapj.rb', line 18

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

#end_suite(suite) ⇒ Object



50
51
52
53
# File 'lib/rubytest/format/tapj.rb', line 50

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

#error(test, exception) ⇒ Object



40
41
42
# File 'lib/rubytest/format/tapj.rb', line 40

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

#fail(test, exception) ⇒ Object



35
36
37
# File 'lib/rubytest/format/tapj.rb', line 35

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

#pass(test) ⇒ Object

, backtrace=nil)



30
31
32
# File 'lib/rubytest/format/tapj.rb', line 30

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

#todo(test, exception) ⇒ Object



45
46
47
# File 'lib/rubytest/format/tapj.rb', line 45

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