Class: DeepTest::Spec::WorkResult
- Inherits:
-
Object
- Object
- DeepTest::Spec::WorkResult
- 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.
6 7 8 9 |
# File 'lib/deep_test/spec/work_result.rb', line 6 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.
4 5 6 |
# File 'lib/deep_test/spec/work_result.rb', line 4 def identifier @identifier end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
4 5 6 |
# File 'lib/deep_test/spec/work_result.rb', line 4 def output @output end |
Instance Method Details
#==(other) ⇒ Object
15 16 17 18 |
# File 'lib/deep_test/spec/work_result.rb', line 15 def ==(other) identifier == other.identifier && @error == other.instance_variable_get(:@error) end |
#deadlock_result ⇒ Object
28 29 30 |
# File 'lib/deep_test/spec/work_result.rb', line 28 def deadlock_result WorkResult.new(identifier, nil, '-deadlock-') end |
#error ⇒ Object
11 12 13 |
# File 'lib/deep_test/spec/work_result.rb', line 11 def error @error.resolve if @error end |
#failed_due_to_deadlock? ⇒ Boolean
20 21 22 |
# File 'lib/deep_test/spec/work_result.rb', line 20 def failed_due_to_deadlock? DeadlockDetector.due_to_deadlock?(@error) end |