Module: Minitest

Defined in:
lib/minitest/risky_plugin.rb

Class Method Summary collapse

Class Method Details

.plugin_risky_init(options) ⇒ Object



30
31
32
# File 'lib/minitest/risky_plugin.rb', line 30

def self.plugin_risky_init(options)
  RSpec::Risky::Minitest::Plugin.install(options.fetch(:risky))
end

.plugin_risky_options(opts, options) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/minitest/risky_plugin.rb', line 9

def self.plugin_risky_options(opts, options)
  options[:risky] = {
    allow_warn: false,
    fail: false,
    redundant_print: true,
    unknown_test: true
  }

  opts.on("--risky-fail", "Fail the run when risky tests are detected.") do
    options[:risky][:fail] = true
  end

  opts.on("--risky-no-output", "Disable stdout/stderr risky detection.") do
    options[:risky][:redundant_print] = false
  end

  opts.on("--risky-allow-warn", "Do not flag Kernel#warn output.") do
    options[:risky][:allow_warn] = true
  end
end