summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-02-11 12:41:58 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-02-11 12:41:58 +0000
commit9c560af1b74ef031ab990ba82362192981407c42 (patch)
treeda9fc68be0d02109e1883000d0b359fe1405e3ad /bin
parent96c078c34029bbc525085c4072b7e1ebcc9ec5a3 (diff)
* bin/testrb, test/runner.rb, lib/test/unit.rb: improve backward
compatibility. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bin')
-rwxr-xr-xbin/testrb21
1 files changed, 8 insertions, 13 deletions
diff --git a/bin/testrb b/bin/testrb
index f4cd42f443..d03f057224 100755
--- a/bin/testrb
+++ b/bin/testrb
@@ -1,15 +1,10 @@
#!/usr/bin/env ruby
require 'test/unit'
-tests = Test::Unit.new {|files|
- if files.empty?
- puts "Usage: testrb [options] tests..."
- exit false
- end
- if files.size == 1
- $0 = File.basename(files[0])
- else
- $0 = files.to_s
- end
- files
-}
-exit tests.run(ARGV) || true
+tests = Test::Unit::AutoRunner.new(true)
+tests.options.banner.sub!(/\[options\]/, '\& tests...')
+unless tests.process_args(ARGV)
+ abort tests.options.banner
+end
+p files = tests.to_run
+$0 = files.size == 1 ? File.basename(files[0]) : files.to_s
+exit tests.run