summaryrefslogtreecommitdiff
path: root/test/lib/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-10 12:24:19 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-10 12:24:19 +0000
commit7dddd592d1f79817947ffe71eb872eb8787b7db0 (patch)
tree63d07630e926599552f700a2e1bb98f8e5452d08 /test/lib/test
parent04196d1f8cf1a3e8095a8cd4d7f1e6dbaa323203 (diff)
test/unit.rb: --excludes-dir list
* test/lib/test/unit.rb (ExcludesOption): allow directory list by PATH_SEPARATOR to --excludes-dir option. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/lib/test')
-rw-r--r--test/lib/test/unit.rb32
1 files changed, 19 insertions, 13 deletions
diff --git a/test/lib/test/unit.rb b/test/lib/test/unit.rb
index 8f6cecf..6dc7028 100644
--- a/test/lib/test/unit.rb
+++ b/test/lib/test/unit.rb
@@ -857,26 +857,32 @@ module Test
end
end
- def self.load(dir, name)
- return unless dir and name
- path = File.join(dir, name.gsub(/::/, '/') + ".rb")
- begin
- src = File.read(path)
- rescue Errno::ENOENT
- nil
- else
- instance = new({})
- instance.instance_eval(src)
- instance
+ def self.load(dirs, name)
+ return unless dirs and name
+ instance = nil
+ dirs.each do |dir|
+ path = File.join(dir, name.gsub(/::/, '/') + ".rb")
+ begin
+ src = File.read(path)
+ rescue Errno::ENOENT
+ nil
+ else
+ instance ||= new({})
+ instance.instance_eval(src)
+ end
end
+ instance
end
end
def setup_options(parser, options)
super
- options[:excludes] = ENV["EXCLUDES"]
+ if excludes = ENV["EXCLUDES"]
+ excludes = excludes.split(File::PATH_SEPARATOR)
+ end
+ options[:excludes] = excludes || []
parser.on '-X', '--excludes-dir DIRECTORY', "Directory name of exclude files" do |d|
- options[:excludes] = d
+ options[:excludes].concat d.split(File::PATH_SEPARATOR)
end
end