summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-13 13:43:36 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-13 13:43:36 +0000
commit45270d20ed715a80314c5622331d580bf26bfcc2 (patch)
tree99471f0deeedfc0c973377dab664e6f16dd8ffd2
parent29b114a1ea1b06a94b19a334a3031574118d2301 (diff)
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
-rw-r--r--spec/mspec/lib/mspec/utils/script.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/spec/mspec/lib/mspec/utils/script.rb b/spec/mspec/lib/mspec/utils/script.rb
index 146e3367af..1c7d0aeb52 100644
--- a/spec/mspec/lib/mspec/utils/script.rb
+++ b/spec/mspec/lib/mspec/utils/script.rb
@@ -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