Class: DeepTest::Test::WorkUnit

Inherits:
Object
  • Object
show all
Defined in:
lib/deep_test/test/work_unit.rb

Instance Method Summary collapse

Constructor Details

#initialize(test_case) ⇒ WorkUnit

Returns a new instance of WorkUnit.



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

def initialize(test_case)
  @test_case = test_case
end

Instance Method Details

#==(other) ⇒ Object



19
20
21
22
# 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

#runObject



8
9
10
11
12
13
14
15
16
17
# 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_sObject



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

def to_s
  @test_case.to_s
end