Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
  • Loading branch information
kjetilho committed Dec 10, 2023
commit c3c8171840bd71557450761bb1842f3a485aa6ca
2 changes: 1 addition & 1 deletion lib/puppetlabs_spec_helper/module_spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def verify_contents(subject, title, expected_lines)

Dir.entries(dir).grep_v(/^\./).map { |f| File.join(dir, f, 'spec', 'lib') }
end
components.flatten.each do |d|
components.compact.flatten.each do |d|
$LOAD_PATH << d if FileTest.directory?(d) && !$LOAD_PATH.include?(d)
end

Expand Down