diff --git a/spec/mspec/lib/mspec/utils/script.rb b/spec/mspec/lib/mspec/utils/script.rb index db5a33a91a..2816618b0f 100644 --- a/spec/mspec/lib/mspec/utils/script.rb +++ b/spec/mspec/lib/mspec/utils/script.rb @@ -189,7 +189,11 @@ class MSpecScript end patterns.each do |pattern| - expanded = File.expand_path(pattern) + begin + expanded = File.realpath(pattern) + rescue Errno::ENOENT + next + end if File.file?(expanded) && expanded.end_with?('.rb') return [expanded] elsif File.directory?(expanded)