Module: Minitest
- Defined in:
- lib/minitest/nicetest_plugin.rb,
lib/minitest/reporters_plugin.rb,
lib/minitest/superdiff_plugin.rb
Class Method Summary collapse
- .plugin_nicetest_init(_options) ⇒ Object
- .plugin_nicetest_options(opts, options) ⇒ Object
- .plugin_reporters_init(options) ⇒ Object
- .plugin_reporters_options(opts, options) ⇒ Object
- .plugin_superdiff_init(options) ⇒ Object
- .plugin_superdiff_options(opts, options) ⇒ Object
Class Method Details
.plugin_nicetest_init(_options) ⇒ Object
13 14 15 |
# File 'lib/minitest/nicetest_plugin.rb', line 13 def plugin_nicetest_init() Minitest.backtrace_filter = Nicetest::BacktraceFilter.new end |
.plugin_nicetest_options(opts, options) ⇒ Object
8 9 10 11 |
# File 'lib/minitest/nicetest_plugin.rb', line 8 def (opts, ) opts. = ::Nicetest::Cli::BANNER Nicetest::NicetestPlugin::ValidateMinitestFocus.apply! end |
.plugin_reporters_init(options) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/minitest/reporters_plugin.rb', line 23 def plugin_reporters_init() return if [:reporters].nil? || [:reporters].empty? require "minitest/reporters" reporters = [:reporters].map do |reporter| Nicetest::ReportersPlugin::MAPPING.fetch(reporter).call() end.compact Minitest::Reporters.use!(reporters, ENV, Minitest.backtrace_filter) unless reporters.empty? end |
.plugin_reporters_options(opts, options) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/minitest/reporters_plugin.rb', line 5 def (opts, ) [:reporters] = ["progress"] vals = Nicetest::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 = [:reporters] + reporters if reporters == ["junit"] is_subset = (reporters - Nicetest::ReportersPlugin::MAPPING.keys).empty? raise OptionParser::InvalidArgument, "Invalid reporter: #{reporters.join(", ")}" unless is_subset [: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() return if [:no_superdiff] require "super_diff" Minitest::Assertions.prepend(Nicetest::SuperdiffPlugin) end |
.plugin_superdiff_options(opts, options) ⇒ Object
5 6 7 8 9 |
# File 'lib/minitest/superdiff_plugin.rb', line 5 def (opts, ) opts.on("--no-superdiff", "Disable superdiff") do [:no_superdiff] = true end end |