Class: DeepTest::Test::WorkResult
- Inherits:
-
Test::Unit::TestResult
- Object
- Test::Unit::TestResult
- DeepTest::Test::WorkResult
- Defined in:
- lib/deep_test/test/work_result.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
-
#output ⇒ Object
Returns the value of attribute output.
-
#time ⇒ Object
Returns the value of attribute time.
Instance Method Summary collapse
-
#add_error(error) ⇒ Object
repackage error to include host.
-
#add_failure(failure) ⇒ Object
repackage failure to include host.
- #add_to(result) ⇒ Object
- #failed_due_to_deadlock? ⇒ Boolean
-
#initialize(identifier) ⇒ WorkResult
constructor
A new instance of WorkResult.
Constructor Details
#initialize(identifier) ⇒ WorkResult
Returns a new instance of WorkResult.
7 8 9 10 |
# File 'lib/deep_test/test/work_result.rb', line 7 def initialize(identifier) super() @identifier = identifier end |
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
5 6 7 |
# File 'lib/deep_test/test/work_result.rb', line 5 def host @host end |
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
4 5 6 |
# File 'lib/deep_test/test/work_result.rb', line 4 def identifier @identifier end |
#output ⇒ Object
Returns the value of attribute output.
5 6 7 |
# File 'lib/deep_test/test/work_result.rb', line 5 def output @output end |
#time ⇒ Object
Returns the value of attribute time.
5 6 7 |
# File 'lib/deep_test/test/work_result.rb', line 5 def time @time end |
Instance Method Details
#add_error(error) ⇒ Object
repackage error to include host
30 31 32 33 34 |
# File 'lib/deep_test/test/work_result.rb', line 30 def add_error(error) e = error.class.new(error.test_name + " [#{@host}]", error.exception) e.make_exception_marshallable super(e) end |
#add_failure(failure) ⇒ Object
repackage failure to include host
25 26 27 |
# File 'lib/deep_test/test/work_result.rb', line 25 def add_failure(failure) super(failure.class.new(failure.test_name + " [#{@host}]", failure.location, failure.)) end |
#add_to(result) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/deep_test/test/work_result.rb', line 12 def add_to(result) @failures.each {|e| result.add_failure(e)} @errors.each do |e| e.resolve_marshallable_exception result.add_error(e) end assertion_count.times {result.add_assertion} run_count.times {result.add_run} end |
#failed_due_to_deadlock? ⇒ Boolean
36 37 38 |
# File 'lib/deep_test/test/work_result.rb', line 36 def failed_due_to_deadlock? @errors.any? && DeepTest::DeadlockDetector.due_to_deadlock?(@errors.last) end |