* 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
@ -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.
|
* lib/test/unit.rb (Test::Unit::Runner): rename from Test::Unit::Mini.
|
||||||
|
|
||||||
|
@ -96,11 +96,10 @@ module Test
|
|||||||
end
|
end
|
||||||
|
|
||||||
def non_options(files, options)
|
def non_options(files, options)
|
||||||
paths = [options.delete(:base_directory), nil].compact
|
paths = [options.delete(:base_directory), nil].uniq
|
||||||
if reject = options.delete(:reject)
|
if reject = options.delete(:reject)
|
||||||
reject_pat = Regexp.union(reject.map {|r| /#{r}/ })
|
reject_pat = Regexp.union(reject.map {|r| /#{r}/ })
|
||||||
end
|
end
|
||||||
files << "" if files.empty?
|
|
||||||
files.map! {|f|
|
files.map! {|f|
|
||||||
f = f.tr(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
|
f = f.tr(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
|
||||||
[*(paths if /\A\.\.?(?:\z|\/)/ !~ f), nil].uniq.any? do |prefix|
|
[*(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)
|
def initialize(force_standalone = false, default_dir = nil, argv = ARGV)
|
||||||
@runner = Runner.new do |files, options|
|
@runner = Runner.new do |files, options|
|
||||||
options[:base_directory] ||= default_dir
|
options[:base_directory] ||= default_dir
|
||||||
|
files << default_dir if files.empty?
|
||||||
@to_run = files
|
@to_run = files
|
||||||
yield self if block_given?
|
yield self if block_given?
|
||||||
files
|
files
|
||||||
|
Loading…
x
Reference in New Issue
Block a user