Class: Torkify::Event::PassOrFailEvent
- Inherits:
-
Struct
- Object
- Struct
- Torkify::Event::PassOrFailEvent
- Includes:
- Message
- Defined in:
- lib/torkify/event/pass_or_fail_event.rb
Overview
Event used for test passes or failures.
Types:
- pass
- fail
Instance Attribute Summary collapse
-
#exit_code ⇒ Object
Returns the value of attribute exit_code.
-
#exit_info ⇒ Object
Returns the value of attribute exit_info.
-
#file ⇒ Object
Returns the value of attribute file.
-
#lines ⇒ Object
Returns the value of attribute lines.
-
#log_file ⇒ Object
Returns the value of attribute log_file.
-
#type ⇒ Object
Returns the value of attribute type.
-
#worker ⇒ Object
Returns the value of attribute worker.
Instance Method Summary collapse
- #errors ⇒ Object
-
#pid ⇒ Object
Get the PID from the exit info.
- #to_s ⇒ Object
Methods included from Message
Instance Attribute Details
#exit_code ⇒ Object
Returns the value of attribute exit_code
11 12 13 |
# File 'lib/torkify/event/pass_or_fail_event.rb', line 11 def exit_code @exit_code end |
#exit_info ⇒ Object
Returns the value of attribute exit_info
11 12 13 |
# File 'lib/torkify/event/pass_or_fail_event.rb', line 11 def exit_info @exit_info end |
#file ⇒ Object
Returns the value of attribute file
11 12 13 |
# File 'lib/torkify/event/pass_or_fail_event.rb', line 11 def file @file end |
#lines ⇒ Object
Returns the value of attribute lines
11 12 13 |
# File 'lib/torkify/event/pass_or_fail_event.rb', line 11 def lines @lines end |
#log_file ⇒ Object
Returns the value of attribute log_file
11 12 13 |
# File 'lib/torkify/event/pass_or_fail_event.rb', line 11 def log_file @log_file end |
#type ⇒ Object
Returns the value of attribute type
11 12 13 |
# File 'lib/torkify/event/pass_or_fail_event.rb', line 11 def type @type end |
#worker ⇒ Object
Returns the value of attribute worker
11 12 13 |
# File 'lib/torkify/event/pass_or_fail_event.rb', line 11 def worker @worker end |
Instance Method Details
#errors ⇒ Object
20 21 22 |
# File 'lib/torkify/event/pass_or_fail_event.rb', line 20 def errors @errors ||= parse_errors_from_log end |
#pid ⇒ Object
Get the PID from the exit info.
15 16 17 18 |
# File 'lib/torkify/event/pass_or_fail_event.rb', line 15 def pid matched = exit_info.scan(/pid ([0-9]+)/).first matched.first.to_i if matched end |
#to_s ⇒ Object
24 25 26 27 |
# File 'lib/torkify/event/pass_or_fail_event.rb', line 24 def to_s s = "#{type.upcase} #{file}" s += lines.any? ? " (lines #{lines.join(', ')})" : '' end |