Class: Specdown::Stats
- Inherits:
-
Object
- Object
- Specdown::Stats
- Defined in:
- lib/specdown/readme/stats.rb
Instance Attribute Summary collapse
-
#readme ⇒ Object
readonly
Returns the value of attribute readme.
Instance Method Summary collapse
-
#initialize(readme = nil) ⇒ Stats
constructor
A new instance of Stats.
- #num_failing ⇒ Object
- #num_passing ⇒ Object
- #num_pending ⇒ Object
- #num_tests ⇒ Object
- #num_undefined ⇒ Object
Constructor Details
#initialize(readme = nil) ⇒ Stats
Returns a new instance of Stats.
5 6 7 |
# File 'lib/specdown/readme/stats.rb', line 5 def initialize(readme=nil) @readme = readme end |
Instance Attribute Details
#readme ⇒ Object (readonly)
Returns the value of attribute readme.
3 4 5 |
# File 'lib/specdown/readme/stats.rb', line 3 def readme @readme end |
Instance Method Details
#num_failing ⇒ Object
17 18 19 |
# File 'lib/specdown/readme/stats.rb', line 17 def num_failing @readme.tests.select {|test| test.status == :failing}.count end |
#num_passing ⇒ Object
13 14 15 |
# File 'lib/specdown/readme/stats.rb', line 13 def num_passing @readme.tests.select {|test| test.status == :passing}.count end |
#num_pending ⇒ Object
21 22 23 |
# File 'lib/specdown/readme/stats.rb', line 21 def num_pending @readme.tests.select {|test| test.status == :pending}.count end |
#num_tests ⇒ Object
9 10 11 |
# File 'lib/specdown/readme/stats.rb', line 9 def num_tests @readme.tests.count end |
#num_undefined ⇒ Object
25 26 27 |
# File 'lib/specdown/readme/stats.rb', line 25 def num_undefined @readme.tests.select {|test| test.status == :undefined}.count end |