Class: RspecDelivery::Tracker
- Inherits:
-
Object
- Object
- RspecDelivery::Tracker
- Defined in:
- lib/rspec_delivery/tracker.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#pending ⇒ Object
Returns the value of attribute pending.
-
#successes ⇒ Object
Returns the value of attribute successes.
Instance Method Summary collapse
- #add(example) ⇒ Object
-
#initialize ⇒ Tracker
constructor
A new instance of Tracker.
Constructor Details
#initialize ⇒ Tracker
Returns a new instance of Tracker.
6 7 8 9 10 |
# File 'lib/rspec_delivery/tracker.rb', line 6 def initialize @errors = [] @successes = [] @pending = [] end |
Instance Attribute Details
#errors ⇒ Object
Returns the value of attribute errors.
4 5 6 |
# File 'lib/rspec_delivery/tracker.rb', line 4 def errors @errors end |
#pending ⇒ Object
Returns the value of attribute pending.
4 5 6 |
# File 'lib/rspec_delivery/tracker.rb', line 4 def pending @pending end |
#successes ⇒ Object
Returns the value of attribute successes.
4 5 6 |
# File 'lib/rspec_delivery/tracker.rb', line 4 def successes @successes end |
Instance Method Details
#add(example) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/rspec_delivery/tracker.rb', line 12 def add(example) # TODO, add exception message (an RSPEC::Expectation::Message obj) status = example.execution_result[:status] = { description: example.full_description, status: status, run_time: example.execution_result[:run_time], file_path: example.file_path, line_number: example.location.split('.rb:')[1] } if status == "failed" @errors << elsif status == "passed" @successes << elsif status == "pending" @pending << end end |