Module: top_level_module::DeepCover::Tools::AfterTests

Extended by:
AfterTests
Included in:
AfterTests
Defined in:
lib/deep_cover/tools/after_tests.rb

Instance Method Summary collapse

Instance Method Details

#after_testsObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/deep_cover/tools/after_tests.rb', line 15

def after_tests
  use_at_exit = true
  if defined?(::Minitest)
    use_at_exit = false
    ::Minitest.after_run { yield }
  end
  if defined?(::Rspec)
    use_at_exit = false
    ::RSpec.configure do |config|
      config.after(:suite) { yield }
    end
  end
  if use_at_exit
    at_exit { yield }
  end
end