Module: Assert::ConfigHelpers

Included in:
Runner, Suite, View
Defined in:
lib/assert/config_helpers.rb

Instance Method Summary collapse

Instance Method Details

#all_pass?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/assert/config_helpers.rb', line 29

def all_pass?
  self.count(:pass) == self.count(:results)
end

#count(type) ⇒ Object



21
22
23
# File 'lib/assert/config_helpers.rb', line 21

def count(type)
  self.config.suite.count(type)
end

#formatted_result_rate(format = '%.6f') ⇒ Object



41
42
43
# File 'lib/assert/config_helpers.rb', line 41

def formatted_result_rate(format = '%.6f')
  format % self.config.suite.result_rate
end

#formatted_run_time(format = '%.6f') ⇒ Object



33
34
35
# File 'lib/assert/config_helpers.rb', line 33

def formatted_run_time(format = '%.6f')
  format % self.config.suite.run_time
end

#formatted_test_rate(format = '%.6f') ⇒ Object



37
38
39
# File 'lib/assert/config_helpers.rb', line 37

def formatted_test_rate(format = '%.6f')
  format % self.config.suite.test_rate
end

#ocurring_result_typesObject

return a list of result symbols that have actually occurred



54
55
56
57
58
# File 'lib/assert/config_helpers.rb', line 54

def ocurring_result_types
  @result_types ||= [:pass, :fail, :ignore, :skip, :error].select do |sym|
    self.count(sym) > 0
  end
end

#runnerObject



5
# File 'lib/assert/config_helpers.rb', line 5

def runner; self.config.runner; end

#runner_seedObject



9
10
11
# File 'lib/assert/config_helpers.rb', line 9

def runner_seed
  self.config.runner_seed
end

#show_test_profile_info?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/assert/config_helpers.rb', line 45

def show_test_profile_info?
  !!self.config.profile
end

#show_test_verbose_info?Boolean

Returns:

  • (Boolean)


49
50
51
# File 'lib/assert/config_helpers.rb', line 49

def show_test_verbose_info?
  !!self.config.verbose
end

#single_test?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/assert/config_helpers.rb', line 13

def single_test?
  self.config.single_test?
end

#single_test_file_lineObject



17
18
19
# File 'lib/assert/config_helpers.rb', line 17

def single_test_file_line
  self.config.single_test_file_line
end

#suiteObject



6
# File 'lib/assert/config_helpers.rb', line 6

def suite;  self.config.suite;  end

#tests?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/assert/config_helpers.rb', line 25

def tests?
  self.count(:tests) > 0
end

#viewObject



7
# File 'lib/assert/config_helpers.rb', line 7

def view;   self.config.view;   end