1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

script.rb: skip empty directories

* spec/mspec/lib/mspec/utils/script.rb (entries): skip empty
  directories so that at least one file would run.

Merged https://github.com/ruby/spec/issues/459

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-08-13 13:43:36 +00:00
parent 29b114a1ea
commit 45270d20ed

View file

@ -188,7 +188,8 @@ class MSpecScript
if File.file?(expanded) && expanded.end_with?('.rb')
return [expanded]
elsif File.directory?(expanded)
return Dir["#{expanded}/**/*_spec.rb"].sort
specs = Dir["#{expanded}/**/*_spec.rb"].sort
return specs unless specs.empty?
end
end