module SimpleCov::CLI::Dotfile
def load_with_start_neutered(path)
for `coverage_dir`. Config inside any `SimpleCov.start { ... }`
`SimpleCov.start` doesn't trigger Coverage just because we asked
turned into no-ops, so a project whose dotfile calls
Load `path` with `SimpleCov.start` and the at_exit installer
def load_with_start_neutered(path) klass = SimpleCov.singleton_class names = %i[start_tracking install_at_exit_hook] stash = names.to_h { |name| [name, klass.instance_method(name)] } #: Hash[Symbol, UnboundMethod] # define_method over an existing method emits a "method redefined" # warning under $VERBOSE; the override and restore are intentional. silence_verbose { names.each { |name| klass.define_method(name) { nil } } } load path ensure # @type var stash: Hash[Symbol, UnboundMethod] # @type var klass: Class silence_verbose { stash.each { |name, method| klass.define_method(name, method) } } end