Class: TLDR::Reporters::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/tldr/reporters/base.rb

Direct Known Subclasses

Default

Instance Method Summary collapse

Constructor Details

#initialize(config, out = $stdout, err = $stderr) ⇒ Base

Returns a new instance of Base.



4
5
6
7
8
9
10
11
# File 'lib/tldr/reporters/base.rb', line 4

def initialize config, out = $stdout, err = $stderr
  out.sync = true
  err.sync = true

  @config = config
  @out = out
  @err = err
end

Instance Method Details

#after_fail_fast(planned_tests, wip_tests, test_results, last_result) ⇒ Object

Called after the first test fails when –fail-fast is enabled, aborting the run



32
33
# File 'lib/tldr/reporters/base.rb', line 32

def after_fail_fast planned_tests, wip_tests, test_results, last_result
end

#after_suite(test_results) ⇒ Object

Will be called after all tests have run, unless the run was aborted

Exactly ONE of ‘after_suite`, `after_tldr`, or `after_fail_fast` will be called



24
25
# File 'lib/tldr/reporters/base.rb', line 24

def after_suite test_results
end

#after_test(test_result) ⇒ Object

Will be called after each test, unless the run has already been aborted



18
19
# File 'lib/tldr/reporters/base.rb', line 18

def after_test test_result
end

#after_tldr(planned_tests, wip_tests, test_results) ⇒ Object

Called after the suite-wide time limit expires and the run is aborted



28
29
# File 'lib/tldr/reporters/base.rb', line 28

def after_tldr planned_tests, wip_tests, test_results
end

#before_suite(tests) ⇒ Object

Will be called before any tests are run



14
15
# File 'lib/tldr/reporters/base.rb', line 14

def before_suite tests
end