diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-02-11 12:41:58 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-02-11 12:41:58 +0000 |
commit | 9c560af1b74ef031ab990ba82362192981407c42 (patch) | |
tree | da9fc68be0d02109e1883000d0b359fe1405e3ad /bin | |
parent | 96c078c34029bbc525085c4072b7e1ebcc9ec5a3 (diff) | |
download | bundler-9c560af1b74ef031ab990ba82362192981407c42.tar.gz |
* 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-x | bin/testrb | 21 |
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 |