summaryrefslogtreecommitdiffstats
path: root/test/runner.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-09-05 15:15:43 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-09-05 15:15:43 +0000
commit5f2f00b828bd9e4ce68e240d290ddff5627afc74 (patch)
tree56830470411bdaf525d1f4c489b120125efb9097 /test/runner.rb
parent4479fc7ca74a1512ce00c013434a8119ad74e426 (diff)
downloadruby-5f2f00b828bd9e4ce68e240d290ddff5627afc74.tar.gz
ruby-5f2f00b828bd9e4ce68e240d290ddff5627afc74.tar.xz
ruby-5f2f00b828bd9e4ce68e240d290ddff5627afc74.zip
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@4516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/runner.rb')
-rw-r--r--test/runner.rb25
1 files changed, 14 insertions, 11 deletions
diff --git a/test/runner.rb b/test/runner.rb
index 8d1b9dc20..b02e2e068 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