Class: Crew::Task::Test::Result
- Inherits:
-
Struct
- Object
- Struct
- Crew::Task::Test::Result
- Defined in:
- lib/crew/task/test.rb
Instance Attribute Summary collapse
-
#context_name ⇒ Object
Returns the value of attribute context_name.
-
#extras ⇒ Object
Returns the value of attribute extras.
-
#index ⇒ Object
Returns the value of attribute index.
-
#status ⇒ Object
Returns the value of attribute status.
-
#task_name ⇒ Object
Returns the value of attribute task_name.
Instance Method Summary collapse
Instance Attribute Details
#context_name ⇒ Object
Returns the value of attribute context_name
10 11 12 |
# File 'lib/crew/task/test.rb', line 10 def context_name @context_name end |
#extras ⇒ Object
Returns the value of attribute extras
10 11 12 |
# File 'lib/crew/task/test.rb', line 10 def extras @extras end |
#index ⇒ Object
Returns the value of attribute index
10 11 12 |
# File 'lib/crew/task/test.rb', line 10 def index @index end |
#status ⇒ Object
Returns the value of attribute status
10 11 12 |
# File 'lib/crew/task/test.rb', line 10 def status @status end |
#task_name ⇒ Object
Returns the value of attribute task_name
10 11 12 |
# File 'lib/crew/task/test.rb', line 10 def task_name @task_name end |
Instance Method Details
#failed? ⇒ Boolean
19 20 21 |
# File 'lib/crew/task/test.rb', line 19 def failed? status == 'fail' end |
#missing? ⇒ Boolean
11 12 13 |
# File 'lib/crew/task/test.rb', line 11 def missing? status == 'missing' end |
#passed? ⇒ Boolean
15 16 17 |
# File 'lib/crew/task/test.rb', line 15 def passed? status == 'pass' end |
#skipped? ⇒ Boolean
23 24 25 |
# File 'lib/crew/task/test.rb', line 23 def skipped? status == 'skip' end |
#to_s ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/crew/task/test.rb', line 27 def to_s out = "#{task_name}##{index} (#{context_name}) = #{status}" if extras['start_time'] && extras['end_time'] out << "\nRan in #{extras['end_time'] - extras['start_time']}" end if extras['exception'] e = extras['exception'] out << "\n#{e['message']} (#{e['class']}): #{e['backtrace'].join("\n ")}" end out end |