Class: Assert::DefaultSuite

Inherits:
Suite
  • Object
show all
Defined in:
lib/assert/default_suite.rb

Overview

This is the default suite used by assert. In addition to the base suite behavior, it accumulates test/result counts in memory. This data is used by the runner/view for handling and presentation purposes.

Instance Attribute Summary collapse

Attributes inherited from Suite

#config, #end_time, #setups, #start_time, #teardowns

Instance Method Summary collapse

Methods inherited from Suite

#after_load, #after_test, #before_load, #clear_tests_to_run, #find_test_to_run, #inspect, #on_finish, #on_info, #on_interrupt, #on_test, #result_rate, #run_time, #setup, #sorted_tests_to_run, #suite, #teardown, #test_rate, #tests_to_run?, #tests_to_run_count

Methods included from ConfigHelpers

#all_pass?, #formatted_result_rate, #formatted_run_time, #formatted_suite_result_rate, #formatted_suite_run_time, #formatted_suite_test_rate, #formatted_test_rate, #ocurring_result_types, #runner, #runner_seed, #show_test_profile_info?, #show_test_verbose_info?, #single_test?, #single_test_file_line, #suite, #tests_to_run?, #tests_to_run_count, #view

Constructor Details

#initialize(config) ⇒ DefaultSuite

Returns a new instance of DefaultSuite.


14
15
16
17
# File 'lib/assert/default_suite.rb', line 14

def initialize(config)
  super
  reset_run_data
end

Instance Attribute Details

#error_result_countObject (readonly)

Returns the value of attribute error_result_count.


11
12
13
# File 'lib/assert/default_suite.rb', line 11

def error_result_count
  @error_result_count
end

#fail_result_countObject (readonly)

Returns the value of attribute fail_result_count.


11
12
13
# File 'lib/assert/default_suite.rb', line 11

def fail_result_count
  @fail_result_count
end

#ignore_result_countObject (readonly)

Returns the value of attribute ignore_result_count.


12
13
14
# File 'lib/assert/default_suite.rb', line 12

def ignore_result_count
  @ignore_result_count
end

#pass_result_countObject (readonly)

Returns the value of attribute pass_result_count.


10
11
12
# File 'lib/assert/default_suite.rb', line 10

def pass_result_count
  @pass_result_count
end

#result_countObject (readonly)

Returns the value of attribute result_count.


10
11
12
# File 'lib/assert/default_suite.rb', line 10

def result_count
  @result_count
end

#skip_result_countObject (readonly)

Returns the value of attribute skip_result_count.


12
13
14
# File 'lib/assert/default_suite.rb', line 12

def skip_result_count
  @skip_result_count
end

#test_countObject (readonly)

Returns the value of attribute test_count.


10
11
12
# File 'lib/assert/default_suite.rb', line 10

def test_count
  @test_count
end

Instance Method Details

#before_test(_test) ⇒ Object


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

def before_test(_test)
  @test_count += 1
end

#on_result(result) ⇒ Object


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

def on_result(result)
  @result_count += 1
  send("increment_#{result.type}_result_count")
end

#on_startObject

Callbacks


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

def on_start
  reset_run_data
end