Sha256: 9e837d514927c873cc39d0b531bf0a708508d5aebec310423069a63668b7bc6c

Contents?: true

Size: 1015 Bytes

Versions: 14

Compression:

Stored size: 1015 Bytes

Contents

# frozen_string_literal: true

# This file is used by projects cloned with clone mode. As such, special care must be taken to
# be compatible with any projects.
# THERE MUST NOT BE ANY USE/REQUIRE OF DEPENDENCIES OF DeepCover HERE
# See deep-cover/core_gem/lib/deep_cover/setup/clone_mode_entry_template.rb for explanation of
# clone mode and of this top_level_module stuff.
top_level_module = Thread.current['_deep_cover_top_level_module'] || Object

module top_level_module::DeepCover # rubocop:disable Naming/ClassAndModuleCamelCase
  module Tools
    module AfterTests
      extend self

      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
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
deep-cover-core-1.1.0 lib/deep_cover/tools/after_tests.rb
deep-cover-core-1.0.0 lib/deep_cover/tools/after_tests.rb
deep-cover-core-0.8.1 lib/deep_cover/tools/after_tests.rb
deep-cover-core-0.8.0 lib/deep_cover/tools/after_tests.rb
deep-cover-core-0.7.10 lib/deep_cover/tools/after_tests.rb
deep-cover-core-0.7.9 lib/deep_cover/tools/after_tests.rb
deep-cover-core-0.7.8 lib/deep_cover/tools/after_tests.rb
deep-cover-core-0.7.7 lib/deep_cover/tools/after_tests.rb
deep-cover-core-0.7.6 lib/deep_cover/tools/after_tests.rb
deep-cover-core-0.7.5 lib/deep_cover/tools/after_tests.rb
deep-cover-core-0.7.4 lib/deep_cover/tools/after_tests.rb
deep-cover-core-0.7.3 lib/deep_cover/tools/after_tests.rb
deep-cover-core-0.7.2 lib/deep_cover/tools/after_tests.rb
deep-cover-core-0.7.1 lib/deep_cover/tools/after_tests.rb