diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-07-22 12:31:40 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-07-22 13:07:03 +0900 |
commit | f6461fa890fa12501fe1696a36ab2cca036477ff (patch) | |
tree | 3fd59d50158aa75117430d7c363843fd6737ae2f /tool | |
parent | 463092b84da7933f307cc8747f948f68ef19f5fd (diff) | |
download | ruby-f6461fa890fa12501fe1696a36ab2cca036477ff.tar.gz |
Only the first argument can be --test-target-dir option
Raise the proper exception when that option is not given but
non-option argument is.
Diffstat (limited to 'tool')
-rw-r--r-- | tool/test/runner.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/tool/test/runner.rb b/tool/test/runner.rb index db23ae2d33..b3cdba6f17 100644 --- a/tool/test/runner.rb +++ b/tool/test/runner.rb @@ -4,14 +4,12 @@ require 'rbconfig' tool_dir = File.dirname(File.dirname(File.realpath(__FILE__))) src_testdir = nil -while opt = ARGV.shift - break if opt == "--" - case opt - when /\A--test-target-dir=(.*?)\z/ - src_testdir = File.realpath($1) - else - raise "unknown runner option: #{ opt }" - end +case ARGV.first +when /\A--test-target-dir=(.*?)\z/ + ARGV.shift + src_testdir = File.realpath($1) +else + raise "unknown runner option: #{ opt }" end raise "#$0: specify --test-target-dir" if !src_testdir |