Class: DeepTest::Test::WorkResult

Inherits:
Test::Unit::TestResult
  • Object
show all
Defined in:
lib/deep_test/test/work_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#identifierObject (readonly)

Returns the value of attribute identifier.



4
5
6
# File 'lib/deep_test/test/work_result.rb', line 4

def identifier
  @identifier
end

#outputObject

Returns the value of attribute output.



5
6
7
# File 'lib/deep_test/test/work_result.rb', line 5

def output
  @output
end

Instance Method Details

#add_error(error) ⇒ Object



24
25
26
27
# File 'lib/deep_test/test/work_result.rb', line 24

def add_error(error)
  error.make_exception_marshallable
  super(error)
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

Returns:

  • (Boolean)


29
30
31
# File 'lib/deep_test/test/work_result.rb', line 29

def failed_due_to_deadlock?
  @errors.any? && DeepTest::DeadlockDetector.due_to_deadlock?(@errors.last)
end