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

#hostObject

Returns the value of attribute host.



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

def host
  @host
end

#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

#timeObject

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.message))
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)


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