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.



1881
1882
1883
1884
# File 'lib/oktest.rb', line 1881

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

Instance Attribute Details

#countsObject (readonly)

Returns the value of attribute counts.



1886
1887
1888
# File 'lib/oktest.rb', line 1886

def counts
  @counts
end

Instance Method Details

#enter_all(runner) ⇒ Object



1888
1889
1890
1891
1892
# File 'lib/oktest.rb', line 1888

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

#enter_scope(scope) ⇒ Object



1900
1901
# File 'lib/oktest.rb', line 1900

def enter_scope(scope)
end

#enter_spec(spec, depth) ⇒ Object



1912
1913
# File 'lib/oktest.rb', line 1912

def enter_spec(spec, depth)
end

#enter_topic(topic, depth) ⇒ Object



1906
1907
# File 'lib/oktest.rb', line 1906

def enter_topic(topic, depth)
end

#exit_all(runner) ⇒ Object



1894
1895
1896
1897
1898
# File 'lib/oktest.rb', line 1894

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

#exit_scope(scope) ⇒ Object



1903
1904
# File 'lib/oktest.rb', line 1903

def exit_scope(scope)
end

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



1915
1916
1917
1918
1919
1920
# File 'lib/oktest.rb', line 1915

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



1909
1910
# File 'lib/oktest.rb', line 1909

def exit_topic(topic, depth)
end