diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-08-13 13:43:36 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-08-13 13:43:36 +0000 |
commit | 45270d20ed715a80314c5622331d580bf26bfcc2 (patch) | |
tree | 99471f0deeedfc0c973377dab664e6f16dd8ffd2 | |
parent | 29b114a1ea1b06a94b19a334a3031574118d2301 (diff) | |
download | ruby-45270d20ed715a80314c5622331d580bf26bfcc2.tar.gz |
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.rb | 3 |
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 |