Class: Grntest::TestSuitesResult

Inherits:
BaseResult show all
Defined in:
lib/grntest/test-suites-runner.rb

Instance Attribute Summary collapse

Attributes inherited from BaseResult

#elapsed_time

Instance Method Summary collapse

Methods inherited from BaseResult

#measure

Constructor Details

#initializeTestSuitesResult

Returns a new instance of TestSuitesResult.



28
29
30
31
32
# File 'lib/grntest/test-suites-runner.rb', line 28

def initialize
  super
  @workers = []
  @n_total_tests = 0
end

Instance Attribute Details

#n_total_testsObject

Returns the value of attribute n_total_tests.



27
28
29
# File 'lib/grntest/test-suites-runner.rb', line 27

def n_total_tests
  @n_total_tests
end

#workersObject

Returns the value of attribute workers.



26
27
28
# File 'lib/grntest/test-suites-runner.rb', line 26

def workers
  @workers
end

Instance Method Details

#have_failure?Boolean

Returns:

  • (Boolean)


67
68
69
70
71
72
# File 'lib/grntest/test-suites-runner.rb', line 67

def have_failure?
  @workers.any? do |worker|
    worker.result.n_failed_tests > 0 or
      worker.result.n_leaked_tests > 0
  end
end

#n_failed_testsObject



51
52
53
# File 'lib/grntest/test-suites-runner.rb', line 51

def n_failed_tests
  collect_count(:n_failed_tests)
end

#n_leaked_testsObject



55
56
57
# File 'lib/grntest/test-suites-runner.rb', line 55

def n_leaked_tests
  collect_count(:n_leaked_tests)
end

#n_not_checked_testsObject



63
64
65
# File 'lib/grntest/test-suites-runner.rb', line 63

def n_not_checked_tests
  collect_count(:n_not_checked_tests)
end

#n_omitted_testsObject



59
60
61
# File 'lib/grntest/test-suites-runner.rb', line 59

def n_omitted_tests
  collect_count(:n_omitted_tests)
end

#n_passed_testsObject



47
48
49
# File 'lib/grntest/test-suites-runner.rb', line 47

def n_passed_tests
  collect_count(:n_passed_tests)
end

#n_testsObject



43
44
45
# File 'lib/grntest/test-suites-runner.rb', line 43

def n_tests
  collect_count(:n_tests)
end

#pass_ratioObject



34
35
36
37
38
39
40
41
# File 'lib/grntest/test-suites-runner.rb', line 34

def pass_ratio
  n_target_tests = n_tests - n_not_checked_tests
  if n_target_tests.zero?
    0
  else
    (n_passed_tests / n_target_tests.to_f) * 100
  end
end