Class: Peck::Counter
Instance Attribute Summary collapse
-
#events ⇒ Object
Returns the value of attribute events.
-
#failed ⇒ Object
Returns the value of attribute failed.
-
#missing ⇒ Object
Returns the value of attribute missing.
-
#passed ⇒ Object
Returns the value of attribute passed.
-
#pending ⇒ Object
Returns the value of attribute pending.
-
#ran ⇒ Object
Returns the value of attribute ran.
Class Method Summary collapse
Instance Method Summary collapse
- #finished_specification(spec) ⇒ Object
-
#initialize ⇒ Counter
constructor
A new instance of Counter.
- #received_exception(spec, exception) ⇒ Object
- #received_missing(spec) ⇒ Object
- #received_pending(label) ⇒ Object
Constructor Details
#initialize ⇒ Counter
Returns a new instance of Counter.
15 16 17 18 19 20 21 |
# File 'lib/peck/counter.rb', line 15 def initialize @ran = @passed = @failed = 0 @pending = [] @missing = [] @events = [] $stdout.sync = true end |
Instance Attribute Details
#events ⇒ Object
Returns the value of attribute events.
13 14 15 |
# File 'lib/peck/counter.rb', line 13 def events @events end |
#failed ⇒ Object
Returns the value of attribute failed.
13 14 15 |
# File 'lib/peck/counter.rb', line 13 def failed @failed end |
#missing ⇒ Object
Returns the value of attribute missing.
13 14 15 |
# File 'lib/peck/counter.rb', line 13 def missing @missing end |
#passed ⇒ Object
Returns the value of attribute passed.
13 14 15 |
# File 'lib/peck/counter.rb', line 13 def passed @passed end |
#pending ⇒ Object
Returns the value of attribute pending.
13 14 15 |
# File 'lib/peck/counter.rb', line 13 def pending @pending end |
#ran ⇒ Object
Returns the value of attribute ran.
13 14 15 |
# File 'lib/peck/counter.rb', line 13 def ran @ran end |
Class Method Details
.instance ⇒ Object
9 10 11 |
# File 'lib/peck/counter.rb', line 9 def self.instance @instance ||= new end |
Instance Method Details
#finished_specification(spec) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/peck/counter.rb', line 23 def finished_specification(spec) @ran += 1 if spec.passed? @passed += 1 elsif spec.failed? @failed += 1 end end |
#received_exception(spec, exception) ⇒ Object
40 41 42 |
# File 'lib/peck/counter.rb', line 40 def received_exception(spec, exception) @events << exception end |
#received_missing(spec) ⇒ Object
36 37 38 |
# File 'lib/peck/counter.rb', line 36 def received_missing(spec) @missing << spec end |
#received_pending(label) ⇒ Object
32 33 34 |
# File 'lib/peck/counter.rb', line 32 def received_pending(label) @pending << label end |