From 9c560af1b74ef031ab990ba82362192981407c42 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 11 Feb 2011 12:41:58 +0000 Subject: * 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 --- bin/testrb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'bin') 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 -- cgit v1.2.3