Class: Specdown::Stats

Inherits:
Object
  • Object
show all
Defined in:
lib/specdown/runner/stats.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source_runner = nil) ⇒ Stats

Returns a new instance of Stats.



6
7
8
9
10
# File 'lib/specdown/runner/stats.rb', line 6

def initialize(source_runner=nil)
  @runner = source_runner
  @tests = 0
  @exceptions = []
end

Instance Attribute Details

#exceptionsObject

Returns the value of attribute exceptions.



3
4
5
# File 'lib/specdown/runner/stats.rb', line 3

def exceptions
  @exceptions
end

#runnerObject (readonly)

Returns the value of attribute runner.



4
5
6
# File 'lib/specdown/runner/stats.rb', line 4

def runner
  @runner
end

#testsObject

Returns the value of attribute tests.



3
4
5
# File 'lib/specdown/runner/stats.rb', line 3

def tests
  @tests
end

Instance Method Details

#failuresObject



16
17
18
# File 'lib/specdown/runner/stats.rb', line 16

def failures
  @exceptions.count
end

#successesObject



12
13
14
# File 'lib/specdown/runner/stats.rb', line 12

def successes
  @tests - @exceptions.count
end