Expand spec files to realpaths

* spec/mspec/lib/mspec/utils/script.rb (MSpecScript#entries): expand
  the given spec path to the realpath, not to require a library by
  realpath and symbolic link path from the spec file.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-09-15 09:48:42 +00:00
parent 257d00223d
commit 958817d50d

View File

@ -189,7 +189,10 @@ class MSpecScript
end end
patterns.each do |pattern| patterns.each do |pattern|
expanded = File.expand_path(pattern) expanded = File.realpath(pattern)
rescue Errno::ENOENT
next
else
if File.file?(expanded) && expanded.end_with?('.rb') if File.file?(expanded) && expanded.end_with?('.rb')
return [expanded] return [expanded]
elsif File.directory?(expanded) elsif File.directory?(expanded)