Module: Minitest

Extended by:
Minitest
Included in:
Minitest
Defined in:
lib/deprecation_toolkit/minitest_hook.rb,
lib/minitest/deprecation_toolkit_plugin.rb

Defined Under Namespace

Classes: Test

Instance Method Summary collapse

Instance Method Details

#plugin_deprecation_toolkit_init(options) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/minitest/deprecation_toolkit_plugin.rb', line 12

def plugin_deprecation_toolkit_init(options)
  return unless using_bundler?

  require "deprecation_toolkit"

  if options[:record_deprecations]
    DeprecationToolkit::Configuration.behavior = DeprecationToolkit::Behaviors::Record
  end

  DeprecationToolkit.add_notify_behavior
  DeprecationToolkit.attach_subscriber
end

#plugin_deprecation_toolkit_options(opts, options) ⇒ Object



6
7
8
9
10
# File 'lib/minitest/deprecation_toolkit_plugin.rb', line 6

def plugin_deprecation_toolkit_options(opts, options)
  opts.on("-r", "--record-deprecations", "Record deprecations") do
    options[:record_deprecations] = true
  end
end