Class: Probatio::Recorder
- Inherits:
-
Object
- Object
- Probatio::Recorder
- Defined in:
- lib/probatio/plugins.rb
Instance Attribute Summary collapse
-
#events ⇒ Object
readonly
Returns the value of attribute events.
Instance Method Summary collapse
- #assertion_count ⇒ Object
- #failed_tests ⇒ Object
- #failure_count ⇒ Object
- #failures ⇒ Object
- #file_count ⇒ Object
- #pending_count ⇒ Object
- #record(ev) ⇒ Object
- #successes ⇒ Object
- #test_count ⇒ Object
- #test_leave_event(test_node) ⇒ Object
- #total_duration ⇒ Object
Instance Attribute Details
#events ⇒ Object (readonly)
Returns the value of attribute events.
14 15 16 |
# File 'lib/probatio/plugins.rb', line 14 def events @events end |
Instance Method Details
#assertion_count ⇒ Object
39 |
# File 'lib/probatio/plugins.rb', line 39 def assertion_count; @events.count { |e| e.name == 'assertion_leave' }; end |
#failed_tests ⇒ Object
36 |
# File 'lib/probatio/plugins.rb', line 36 def failed_tests; @events.select { |e| e.name == 'test_fail' }; end |
#failure_count ⇒ Object
40 |
# File 'lib/probatio/plugins.rb', line 40 def failure_count; @events.count { |e| e.name == 'test_fail' }; end |
#failures ⇒ Object
21 |
# File 'lib/probatio/plugins.rb', line 21 def failures; @events.select { |ev| ev.name == 'test_fail' }; end |
#file_count ⇒ Object
43 44 45 46 |
# File 'lib/probatio/plugins.rb', line 43 def file_count @events.map(&:path).compact.uniq.count end |
#pending_count ⇒ Object
41 |
# File 'lib/probatio/plugins.rb', line 41 def pending_count; @events.count { |e| e.name == 'test_pending' }; end |
#record(ev) ⇒ Object
16 17 18 19 |
# File 'lib/probatio/plugins.rb', line 16 def record(ev) (@events ||= []) << ev end |
#successes ⇒ Object
22 |
# File 'lib/probatio/plugins.rb', line 22 def successes; @events.select { |ev| ev.name == 'test_succeed' }; end |
#test_count ⇒ Object
38 |
# File 'lib/probatio/plugins.rb', line 38 def test_count; @events.count { |e| e.name == 'test_leave' }; end |
#test_leave_event(test_node) ⇒ Object
24 25 26 27 28 29 |
# File 'lib/probatio/plugins.rb', line 24 def test_leave_event(test_node) @events.find { |e| e.name == 'test_leave' && e.node_full_name == test_node.full_name } end |
#total_duration ⇒ Object
31 32 33 34 |
# File 'lib/probatio/plugins.rb', line 31 def total_duration @events.last.tstamp - @events.first.tstamp end |