Module: Minitest
- Defined in:
- lib/minitest/nicetest_plugin.rb,
lib/minitest/reporters_plugin.rb,
lib/minitest/superdiff_plugin.rb
Defined Under Namespace
Modules: ReportersPlugin, SuperdiffPlugin, ValidateMinitestFocus
Classes: AssertIncludesMessage
Class Method Summary
collapse
Class Method Details
.plugin_nicetest_init(_options) ⇒ Object
.plugin_nicetest_options(opts, options) ⇒ Object
.plugin_reporters_init(options) ⇒ Object
37
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/minitest/reporters_plugin.rb', line 37
def plugin_reporters_init(options)
return if options[:reporters].nil? || options[:reporters].empty?
require "minitest/reporters"
reporters = options[:reporters].map do |reporter|
ReportersPlugin::MAPPING.fetch(reporter).call(options)
end.compact
Minitest::Reporters.use!(reporters, ENV, Minitest.backtrace_filter) unless reporters.empty?
end
|
.plugin_reporters_options(opts, options) ⇒ Object
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/minitest/reporters_plugin.rb', line 19
def plugin_reporters_options(opts, options)
options[:reporters] = ["progress"]
vals = Minitest::ReportersPlugin::MAPPING.keys.join(",")
description = <<~DESC.strip
The reporters to use for test output as comma-seperated list.
DESC
opts.on("-r", "--reporter #{vals}", Array, description) do |reporters|
reporters = options[:reporters] + reporters if reporters == ["junit"]
is_subset = (reporters - Minitest::ReportersPlugin::MAPPING.keys).empty?
raise OptionParser::InvalidArgument, "Invalid reporter: #{reporters.join(", ")}" unless is_subset
options[:reporters] = reporters
end
end
|
.plugin_superdiff_init(options) ⇒ Object
11
12
13
14
15
16
|
# File 'lib/minitest/superdiff_plugin.rb', line 11
def plugin_superdiff_init(options)
return if options[:no_superdiff]
require "super_diff"
Minitest::Assertions.prepend(SuperdiffPlugin)
end
|
.plugin_superdiff_options(opts, options) ⇒ Object
5
6
7
8
9
|
# File 'lib/minitest/superdiff_plugin.rb', line 5
def plugin_superdiff_options(opts, options)
opts.on("--no-superdiff", "Disable superdiff") do
options[:no_superdiff] = true
end
end
|