Class: Teabag::Formatters::TapYFormatter

Inherits:
BaseFormatter show all
Defined in:
lib/teabag/formatters/tap_y_formatter.rb

Instance Attribute Summary

Attributes inherited from BaseFormatter

#errors, #failures, #passes, #pendings, #total

Instance Method Summary collapse

Methods inherited from BaseFormatter

#exception, #initialize, #suppress_logs?

Constructor Details

This class inherits a constructor from Teabag::Formatters::BaseFormatter

Instance Method Details

#error(error) ⇒ Object



44
45
46
# File 'lib/teabag/formatters/tap_y_formatter.rb', line 44

def error(error)
  @errors << error
end

#result(result) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/teabag/formatters/tap_y_formatter.rb', line 30

def result(result)
  log "type" => "final",
      "time" => result.elapsed,
      "counts" => {
        "total" => @total,
        "pass"  => @passes.size,
        "fail"  => @failures.size,
        "error" => @errors.size,
        "omit"  => 0,
        "todo"  => @pendings.size
      }
  super
end

#runner(result) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/teabag/formatters/tap_y_formatter.rb', line 8

def runner(result)
  log "type"  => "suite",
      "start" => result.start,
      "count" => result.total,
      "seed"  => 0,
      "rev"   => 4
end

#spec(result) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/teabag/formatters/tap_y_formatter.rb', line 22

def spec(result)
  super
  @result = result
  return passing_spec if result.passing?
  return pending_spec if result.pending?
  failing_spec
end

#suite(result) ⇒ Object



16
17
18
19
20
# File 'lib/teabag/formatters/tap_y_formatter.rb', line 16

def suite(result)
  log "type"  => "case",
      "label" => result.label,
      "level" => result.level
end