diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-02-12 05:41:38 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-02-12 05:41:38 +0000 |
commit | aca69e1fdc8ebf75f80b665a9d42bedc2410bd7e (patch) | |
tree | 9778dcabeb6617759f7a92f3b39b1575f605c0ef | |
parent | 4e3df72f0d8542edbf34d2c225fecfe402e78570 (diff) | |
download | ruby-aca69e1fdc8ebf75f80b665a9d42bedc2410bd7e.tar.gz |
* 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
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/test/unit.rb | 4 |
2 files changed, 6 insertions, 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. diff --git a/lib/test/unit.rb b/lib/test/unit.rb index 458d5ab3ca..d079f47d42 100644 --- a/lib/test/unit.rb +++ b/lib/test/unit.rb @@ -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 |