diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-09-05 15:15:43 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-09-05 15:15:43 +0000 |
commit | 44785befeabd09d5d34f33b33783c0ec54f06a1f (patch) | |
tree | 56830470411bdaf525d1f4c489b120125efb9097 /test/runner.rb | |
parent | 01e3a55648559ba3d54cdf72d5c55f71a41e69e9 (diff) |
* lib/optparse.rb (OptionParser#order, #permute, #parse): allow an
array as argument.
* test/ruby/test_*.rb: moved invariants to left side in
assert_equal, and use assert_nil, assert_raises and so on.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/runner.rb')
-rw-r--r-- | test/runner.rb | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/test/runner.rb b/test/runner.rb index 8d1b9dc20c..b02e2e0681 100644 --- a/test/runner.rb +++ b/test/runner.rb @@ -33,20 +33,23 @@ runners_map = { } runner = 'console' -ARGV.options do |opt| - opt.program_name = $0 - opt.banner << " [tests...]" - opt.on("--runner=mode", runners_map.keys, "UI mode (console, gtk,fox)") do |arg| - runner = arg - end - opt.parse! -end or abort(ARGV.options.help) +opt = OptionParser.new +opt.program_name = $0 +opt.banner << " [tests...]" +opt.on("--runner=mode", runners_map.keys, "UI mode (console, gtk,fox)") do |arg| + runner = arg +end +begin + argv = opt.parse(*ARGV) +rescue OptionParser::ParseError + opt.abort($!) +end -if ARGV.empty? - ARGV.replace(Dir.glob(File.join(File.dirname(__FILE__), "**", "test_*.rb")).sort) +if argv.empty? + argv = Dir.glob(File.join(File.dirname(__FILE__), "**", "test_*.rb")).sort end -ARGV.each do |tc_name| +argv.each do |tc_name| require tc_name end |