Class: Specwrk::Worker::CompletionFormatter
- Inherits:
-
Object
- Object
- Specwrk::Worker::CompletionFormatter
- Defined in:
- lib/specwrk/worker/completion_formatter.rb
Instance Attribute Summary collapse
-
#examples ⇒ Object
readonly
Returns the value of attribute examples.
Instance Method Summary collapse
-
#initialize ⇒ CompletionFormatter
constructor
A new instance of CompletionFormatter.
- #stop(group_notification) ⇒ Object
Constructor Details
#initialize ⇒ CompletionFormatter
Returns a new instance of CompletionFormatter.
10 11 12 |
# File 'lib/specwrk/worker/completion_formatter.rb', line 10 def initialize @examples = [] end |
Instance Attribute Details
#examples ⇒ Object (readonly)
Returns the value of attribute examples.
8 9 10 |
# File 'lib/specwrk/worker/completion_formatter.rb', line 8 def examples @examples end |
Instance Method Details
#stop(group_notification) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/specwrk/worker/completion_formatter.rb', line 14 def stop(group_notification) group_notification.notifications.map do |notification| hash = { id: notification.example.id, full_description: notification.example.full_description, status: notification.example.execution_result.status, file_path: notification.example.[:file_path], line_number: notification.example.[:line_number], started_at: notification.example.execution_result.started_at.iso8601(6), finished_at: notification.example.execution_result.finished_at.iso8601(6), run_time: notification.example.execution_result.run_time } if (e = notification.example.exception) hash[:exception] = { class: e.class.name, message: e., backtrace: notification.formatted_backtrace } end examples << hash end end |