Class: Bucky::TestEquipment::TestCase::AbstTestCase

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
lib/bucky/test_equipment/test_case/abst_test_case.rb

Direct Known Subclasses

E2eTestCase, LinkstatusTestCase

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.shutdownObject



19
20
21
# File 'lib/bucky/test_equipment/test_case/abst_test_case.rb', line 19

def shutdown
  @@this_result.save(@@added_result_info) unless $debug
end

.startupObject



12
13
14
15
16
17
# File 'lib/bucky/test_equipment/test_case/abst_test_case.rb', line 12

def startup
  return if $debug

  @@this_result = Bucky::Core::TestCore::TestResult.instance
  @@added_result_info = {}
end

Instance Method Details

#cleanupObject



52
# File 'lib/bucky/test_equipment/test_case/abst_test_case.rb', line 52

def cleanup; end

#run(result) ⇒ Object

Override Test::Unit::TestCase#run Save test result to own test result object.



26
27
28
29
30
31
32
33
34
35
# File 'lib/bucky/test_equipment/test_case/abst_test_case.rb', line 26

def run(result)
  super
  @@this_result.result = result unless $debug
  w_pipe.puts({
    test_class_name: self.class.name,
    cases_count: result.run_count,
    success_count: result.pass_count,
    failure_count: result.run_count - result.pass_count
  }.to_json)
end

#setupObject



37
38
39
40
# File 'lib/bucky/test_equipment/test_case/abst_test_case.rb', line 37

def setup
  # To make it easy to read
  puts "\n"
end

#teardownObject



42
43
44
45
46
47
48
49
50
# File 'lib/bucky/test_equipment/test_case/abst_test_case.rb', line 42

def teardown
  return if $debug

  @@added_result_info[method_name.to_sym] = {
    test_suite_id: suite_id,
    elapsed_time: Time.now - start_time,
    case_name: description
  }
end