Class: Oktest::BaseReporter

Inherits:
Reporter show all
Defined in:
lib/oktest.rb

Constant Summary collapse

LABELS =
{ :PASS=>'pass', :FAIL=>'Fail', :ERROR=>'ERROR', :SKIP=>'Skip', :TODO=>'TODO' }
CHARS =
{ :PASS=>'.', :FAIL=>'f', :ERROR=>'E', :SKIP=>'s', :TODO=>'t' }

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Reporter

#order_policy

Constructor Details

#initializeBaseReporter

Returns a new instance of BaseReporter.



1744
1745
1746
1747
# File 'lib/oktest.rb', line 1744

def initialize()
  @exceptions = []
  @counts = {}
end

Instance Attribute Details

#countsObject (readonly)

Returns the value of attribute counts.



1749
1750
1751
# File 'lib/oktest.rb', line 1749

def counts
  @counts
end

Instance Method Details

#enter_all(runner) ⇒ Object



1751
1752
1753
1754
1755
# File 'lib/oktest.rb', line 1751

def enter_all(runner)
  #; [!pq3ia] initalizes counter by zero.
  reset_counts()
  @start_at = Time.now
end

#enter_scope(scope) ⇒ Object



1763
1764
# File 'lib/oktest.rb', line 1763

def enter_scope(scope)
end

#enter_spec(spec, depth) ⇒ Object



1775
1776
# File 'lib/oktest.rb', line 1775

def enter_spec(spec, depth)
end

#enter_topic(topic, depth) ⇒ Object



1769
1770
# File 'lib/oktest.rb', line 1769

def enter_topic(topic, depth)
end

#exit_all(runner) ⇒ Object



1757
1758
1759
1760
1761
# File 'lib/oktest.rb', line 1757

def exit_all(runner)
  #; [!wjp7u] prints footer with elapsed time.
  elapsed = Time.now - @start_at
  puts footer(elapsed)
end

#exit_scope(scope) ⇒ Object



1766
1767
# File 'lib/oktest.rb', line 1766

def exit_scope(scope)
end

#exit_spec(spec, depth, status, exc, parent) ⇒ Object



1778
1779
1780
1781
1782
1783
# File 'lib/oktest.rb', line 1778

def exit_spec(spec, depth, status, exc, parent)
  #; [!r6yge] increments counter according to status.
  @counts[status] += 1
  #; [!nupb4] keeps exception info when status is FAIL or ERROR.
  @exceptions << [spec, status, exc, parent] if status == :FAIL || status == :ERROR
end

#exit_topic(topic, depth) ⇒ Object



1772
1773
# File 'lib/oktest.rb', line 1772

def exit_topic(topic, depth)
end