Class: DeepTest::Spec::WorkResult
- Inherits:
-
Object
- Object
- DeepTest::Spec::WorkResult
- Includes:
- CentralCommand::Result
- Defined in:
- lib/deep_test/spec/work_result.rb
Instance Attribute Summary collapse
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #deadlock_result ⇒ Object
- #error ⇒ Object
- #failed_due_to_deadlock? ⇒ Boolean
-
#initialize(identifier, error, output) ⇒ WorkResult
constructor
A new instance of WorkResult.
- #success? ⇒ Boolean
Constructor Details
#initialize(identifier, error, output) ⇒ WorkResult
Returns a new instance of WorkResult.
8 9 10 11 |
# File 'lib/deep_test/spec/work_result.rb', line 8 def initialize(identifier, error, output) @identifier, @output = identifier, output @error = MarshallableExceptionWrapper.new error if error end |
Instance Attribute Details
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
6 7 8 |
# File 'lib/deep_test/spec/work_result.rb', line 6 def identifier @identifier end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
6 7 8 |
# File 'lib/deep_test/spec/work_result.rb', line 6 def output @output end |
Instance Method Details
#==(other) ⇒ Object
17 18 19 20 |
# File 'lib/deep_test/spec/work_result.rb', line 17 def ==(other) identifier == other.identifier && @error == other.instance_variable_get(:@error) end |
#deadlock_result ⇒ Object
30 31 32 |
# File 'lib/deep_test/spec/work_result.rb', line 30 def deadlock_result WorkResult.new(identifier, nil, '-deadlock-') end |
#error ⇒ Object
13 14 15 |
# File 'lib/deep_test/spec/work_result.rb', line 13 def error @error.resolve if @error end |
#failed_due_to_deadlock? ⇒ Boolean
22 23 24 |
# File 'lib/deep_test/spec/work_result.rb', line 22 def failed_due_to_deadlock? DeadlockDetector.due_to_deadlock?(@error) end |