Module: Minitest

Defined in:
lib/minitest/sprint.rb,
lib/minitest/path_expander.rb,
lib/minitest/sprint_plugin.rb

Overview

:startdoc:

Defined Under Namespace

Classes: PathExpander, Sprint, VendoredPathExpander

Class Method Summary collapse

Class Method Details

.plugin_sprint_init(options) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
# File 'lib/minitest/sprint_plugin.rb', line 28

def self.plugin_sprint_init options
  require_relative "sprint"
  case options[:sprint]
  when :rake then
    self.reporter << Minitest::Sprint::RakeReporter.new(options[:rake_task])
  when :binstub, :names then
    self.reporter << Minitest::Sprint::SprintReporter.new
  when :lines then
    self.reporter << Minitest::Sprint::SprintReporter.new(:lines)
  end
end

.plugin_sprint_options(opts, options) ⇒ Object

:nodoc:



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/minitest/sprint_plugin.rb', line 13

def self.plugin_sprint_options opts, options # :nodoc:
  opts.on "--rake [TASK]", "Report how to re-run failures with rake." do |task|
    options[:sprint] = :rake
    options[:rake_task] = task
  end

  opts.deprecate "--binstub", "--rerun"

  sprint_styles = %w[rake lines names binstub]

  opts.on "-r", "--rerun [STYLE]", sprint_styles, "Report how to re-run failures using STYLE (names, lines)." do |style|
    options[:sprint] = (style || :lines).to_sym
  end
end