mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/test/unit.rb (Test::Unit::AutoRunner#initialize): use
default_dir if no test case given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4e3df72f0d
commit
aca69e1fdc
2 changed files with 6 additions and 3 deletions
|
@ -1,4 +1,7 @@
|
|||
Sat Feb 12 14:40:59 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
Sat Feb 12 14:41:36 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* lib/test/unit.rb (Test::Unit::AutoRunner#initialize): use
|
||||
default_dir if no test case given.
|
||||
|
||||
* lib/test/unit.rb (Test::Unit::Runner): rename from Test::Unit::Mini.
|
||||
|
||||
|
|
|
@ -96,11 +96,10 @@ module Test
|
|||
end
|
||||
|
||||
def non_options(files, options)
|
||||
paths = [options.delete(:base_directory), nil].compact
|
||||
paths = [options.delete(:base_directory), nil].uniq
|
||||
if reject = options.delete(:reject)
|
||||
reject_pat = Regexp.union(reject.map {|r| /#{r}/ })
|
||||
end
|
||||
files << "" if files.empty?
|
||||
files.map! {|f|
|
||||
f = f.tr(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
|
||||
[*(paths if /\A\.\.?(?:\z|\/)/ !~ f), nil].uniq.any? do |prefix|
|
||||
|
@ -228,6 +227,7 @@ module Test
|
|||
def initialize(force_standalone = false, default_dir = nil, argv = ARGV)
|
||||
@runner = Runner.new do |files, options|
|
||||
options[:base_directory] ||= default_dir
|
||||
files << default_dir if files.empty?
|
||||
@to_run = files
|
||||
yield self if block_given?
|
||||
files
|
||||
|
|
Loading…
Reference in a new issue