Skip to content

Commit b0e420c

Browse files
committed
Skip non-existing paths in $MODULEPATH silently
In `map`, a `next` will leave a `nil` value in the array. This is a problem since `FileTest.directory? nil` raises "TypeError: no implicit conversion of nil into String" Bug was introduced in v4.0.1, in commit b6bfd6f
1 parent 66ceded commit b0e420c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/puppetlabs_spec_helper/module_spec_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def verify_contents(subject, title, expected_lines)
5757
next unless Dir.exist? dir
5858

5959
Dir.entries(dir).grep_v(/^\./).map { |f| File.join(dir, f, 'spec', 'lib') }
60-
end
60+
end.reject do |e| e.nil? end
6161
components.flatten.each do |d|
6262
$LOAD_PATH << d if FileTest.directory?(d) && !$LOAD_PATH.include?(d)
6363
end

0 commit comments

Comments
 (0)