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.



1796
1797
1798
1799
# File 'lib/oktest.rb', line 1796

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

Instance Attribute Details

#countsObject (readonly)

Returns the value of attribute counts.



1801
1802
1803
# File 'lib/oktest.rb', line 1801

def counts
  @counts
end

Instance Method Details

#enter_all(runner) ⇒ Object



1803
1804
1805
1806
1807
# File 'lib/oktest.rb', line 1803

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

#enter_scope(scope) ⇒ Object



1815
1816
# File 'lib/oktest.rb', line 1815

def enter_scope(scope)
end

#enter_spec(spec, depth) ⇒ Object



1827
1828
# File 'lib/oktest.rb', line 1827

def enter_spec(spec, depth)
end

#enter_topic(topic, depth) ⇒ Object



1821
1822
# File 'lib/oktest.rb', line 1821

def enter_topic(topic, depth)
end

#exit_all(runner) ⇒ Object



1809
1810
1811
1812
1813
# File 'lib/oktest.rb', line 1809

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

#exit_scope(scope) ⇒ Object



1818
1819
# File 'lib/oktest.rb', line 1818

def exit_scope(scope)
end

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



1830
1831
1832
1833
1834
1835
# File 'lib/oktest.rb', line 1830

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



1824
1825
# File 'lib/oktest.rb', line 1824

def exit_topic(topic, depth)
end