method
process_args
v1_9_3_392 -
Show latest stable
-
0 notes -
Class: Unit
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125 (0)
- 1_9_3_392 (0)
- 2_1_10 (0)
- 2_2_9
- 2_4_6
- 2_5_5
- 2_6_3
- What's this?
process_args(args = [])
public
Hide source
# File lib/minitest/unit.rb, line 837 def process_args args = [] options = {} orig_args = args.dup OptionParser.new do |opts| opts.banner = '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.to_i end opts.on '-v', '--verbose', "Verbose. Show progress processing files." do options[:verbose] = true end opts.on '-n', '--name PATTERN', "Filter test names on pattern." do |a| options[:filter] = a end opts.parse! args orig_args -= args end unless options[:seed] then srand options[:seed] = srand % 0xFFFF orig_args << "--seed" << options[:seed].to_s end srand options[:seed] self.verbose = options[:verbose] @help = orig_args.map { |s| s =~ /[\s|&<>$()]/ ? s.inspect : s }.join " " options end