summaryrefslogtreecommitdiff
path: root/test/lib
diff options
context:
space:
mode:
Diffstat (limited to 'test/lib')
-rw-r--r--test/lib/test/unit.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/lib/test/unit.rb b/test/lib/test/unit.rb
index 105a9a897d..3f74c7f5e2 100644
--- a/test/lib/test/unit.rb
+++ b/test/lib/test/unit.rb
@@ -892,10 +892,15 @@ module Test
next if f.empty?
path = f
end
- if !(match = (Dir["#{path}/**/#{@@testfile_prefix}_*.rb"] + Dir["#{path}/**/*_#{@@testfile_suffix}.rb"]).uniq).empty?
+ if f.end_with?(File::SEPARATOR) or !f.include?(File::SEPARATOR) or File.directory?(path)
+ match = (Dir["#{path}/**/#{@@testfile_prefix}_*.rb"] + Dir["#{path}/**/*_#{@@testfile_suffix}.rb"]).uniq
+ else
+ match = Dir[path]
+ end
+ if !match.empty?
if reject
match.reject! {|n|
- n[(prefix.length+1)..-1] if prefix
+ n = n[(prefix.length+1)..-1] if prefix
reject_pat =~ n
}
end