summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-03 08:56:22 +0000
committerkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-03 08:56:22 +0000
commit98d69f426fc1243de3817e602fe2da959962375e (patch)
treee29619c3c40a3b2d359fbeaf3cc0d09f0aa8c92d /lib
parent0ae90522a684de90e38b45fa8e5d027b04049861 (diff)
* bin/testrb: Use only Test::Unit::AutoRunner in test-unit gem
compatible API to be available by both test/unit bundled in Ruby and test-unit gem. * lib/test/unit.rb (Test::Unit::AutoRunner): Move codes from testrb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/test/unit.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/test/unit.rb b/lib/test/unit.rb
index d1d40524a8..e08087154d 100644
--- a/lib/test/unit.rb
+++ b/lib/test/unit.rb
@@ -804,6 +804,7 @@ module Test
attr_accessor :to_run, :options
def initialize(force_standalone = false, default_dir = nil, argv = ARGV)
+ @force_standalone = force_standalone
@runner = Runner.new do |files, options|
options[:base_directory] ||= default_dir
files << default_dir if files.empty? and default_dir
@@ -813,6 +814,9 @@ module Test
end
Runner.runner = @runner
@options = @runner.option_parser
+ if @force_standalone
+ @options.banner.sub!(/\[options\]/, '\& tests...')
+ end
@argv = argv
end
@@ -822,6 +826,9 @@ module Test
end
def run
+ if @force_standalone and not process_args(@argv)
+ abort @options.banner
+ end
@runner.run(@argv) || true
end