class DeepTest::Test::WorkUnit

Public Class Methods

new(test_case) click to toggle source
# File lib/deep_test/test/work_unit.rb, line 4
def initialize(test_case)
  @test_case = test_case
end

Public Instance Methods

==(other) click to toggle source
# File lib/deep_test/test/work_unit.rb, line 19
def ==(other)
  return false unless other.class == self.class
  @test_case == other.instance_variable_get(:@test_case)
end
run() click to toggle source
# File lib/deep_test/test/work_unit.rb, line 8
def run
  result = run_without_deadlock_protection 
  result = run_without_deadlock_protection if result.failed_due_to_deadlock?
  if result.failed_due_to_deadlock?
    result = WorkResult.new(@test_case.name)
    result.add_run
    result.output = "-deadlock-"
  end
  result
end
to_s() click to toggle source
# File lib/deep_test/test/work_unit.rb, line 24
def to_s
  @test_case.to_s
end

Protected Instance Methods

run_without_deadlock_protection() click to toggle source
# File lib/deep_test/test/work_unit.rb, line 30
def run_without_deadlock_protection
  result = WorkResult.new(@test_case.name)
  output = capture_stdout do
    @test_case.run(result) {|channel,event|}
  end
  result.output = output
  result
end