Don't read non .rb file as a spec

To avoid reading `core` file on reading core/ specs.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2017-05-14 11:36:01 +00:00
Родитель 0e2e2cf4a1
Коммит 7334e2f836
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -185,7 +185,7 @@ class MSpecScript
patterns.each do |pattern|
expanded = File.expand_path(pattern)
if File.file?(expanded)
if File.file?(expanded) && expanded.end_with?('.rb')
return [expanded]
elsif File.directory?(expanded)
return Dir["#{expanded}/**/*_spec.rb"].sort