Class: Specdown::Stats
- Inherits:
-
Object
- Object
- Specdown::Stats
- Defined in:
- lib/specdown/runner/stats.rb
Instance Attribute Summary collapse
-
#exceptions ⇒ Object
Returns the value of attribute exceptions.
-
#runner ⇒ Object
readonly
Returns the value of attribute runner.
-
#tests ⇒ Object
Returns the value of attribute tests.
Instance Method Summary collapse
- #failures ⇒ Object
-
#initialize(source_runner = nil) ⇒ Stats
constructor
A new instance of Stats.
- #successes ⇒ Object
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
#exceptions ⇒ Object
Returns the value of attribute exceptions.
3 4 5 |
# File 'lib/specdown/runner/stats.rb', line 3 def exceptions @exceptions end |
#runner ⇒ Object (readonly)
Returns the value of attribute runner.
4 5 6 |
# File 'lib/specdown/runner/stats.rb', line 4 def runner @runner end |
#tests ⇒ Object
Returns the value of attribute tests.
3 4 5 |
# File 'lib/specdown/runner/stats.rb', line 3 def tests @tests end |
Instance Method Details
#failures ⇒ Object
16 17 18 |
# File 'lib/specdown/runner/stats.rb', line 16 def failures @exceptions.count end |
#successes ⇒ Object
12 13 14 |
# File 'lib/specdown/runner/stats.rb', line 12 def successes @tests - @exceptions.count end |