Methods
N
O
P
S
Class Public methods
new(*, &block)
# File ../ruby/lib/test/unit.rb, line 33
def initialize(*, &block)
  @init_hook = block
  @options = nil
  super(&nil)
end
Instance Public methods
option_parser()
# File ../ruby/lib/test/unit.rb, line 39
def option_parser
  @option_parser ||= OptionParser.new
end
process_args(args = [])
# File ../ruby/lib/test/unit.rb, line 43
def process_args(args = [])
  return @options if @options
  orig_args = args.dup
  options = {}
  opts = option_parser
  setup_options(opts, options)
  opts.parse!(args)
  orig_args -= args
  args = @init_hook.call(args, options) if @init_hook
  non_options(args, options)
  @help = orig_args.map { |s| s =~ /[\s|&<>$()]/ ? s.inspect : s }.join " "
  @options = options
  if @options[:parallel]
    @files = args
    @args = orig_args
  end
  options
end
Instance Private methods
non_options(files, options)
# File ../ruby/lib/test/unit.rb, line 112
def non_options(files, options)
  begin
    require "rbconfig"
  rescue LoadError
    warn "#{caller(1)[0]}: warning: Parallel running disabled because can't get path to ruby; run specify with --ruby argument"
    options[:parallel] = nil
  else
    options[:ruby] ||= RbConfig.ruby
  end

  true
end
setup_options(opts, options)
# File ../ruby/lib/test/unit.rb, line 63
def setup_options(opts, options)
  opts.separator 'minitest options:'
  opts.version = MiniTest::Unit::VERSION

  opts.on '-h', '--help', 'Display this help.' do
    puts opts
    exit
  end

  opts.on '-s', '--seed SEED', Integer, "Sets random seed" do |m|
    options[:seed] = m
  end

  opts.on '-v', '--verbose', "Verbose. Show progress processing files." do
    options[:verbose] = true
    self.verbose = options[:verbose]
  end

  opts.on '-n', '--name PATTERN', "Filter test names on pattern." do |a|
    options[:filter] = a
  end

  opts.on '--jobs-status [TYPE]', [:normal, :replace],
          "Show status of jobs every file; Disabled when --jobs isn't specified." do |type|
    options[:job_status] = type || :normal
  end

  opts.on '-j N', '--jobs N', "Allow run tests with N jobs at once" do |a|
    if /^t/ =~ a
      options[:testing] = true # For testing
      options[:parallel] = a[1..-1].to_i
    else
      options[:parallel] = a.to_i
    end
  end

  opts.on '--no-retry', "Don't retry running testcase when --jobs specified" do
    options[:no_retry] = true
  end

  opts.on '--ruby VAL', "Path to ruby; It'll have used at -j option" do |a|
    options[:ruby] = a.split(/ /).reject(&:empty?)
  end

  opts.on '-q', '--hide-skip', 'Hide skipped tests' do
    options[:hide_skip] = true
  end
end