Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip non-existing paths in $MODULEPATH silently #419

Merged
merged 1 commit into from
Dec 10, 2023

Conversation

kjetilho
Copy link
Contributor

Summary

If one or more components in $MODULEPATH do not exist as directories, loading tests will fail with an exception.

Additional Context

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"

I have not seen any difference in behaviour for FileTest.directory? or next in .map from Ruby 2.3 to 3.2.

Related Issues (if any)

Bug was introduced in v4.0.1, in commit b6bfd6f

For whatever reason, I have stuck to 2.15 for all this time, and that version handles missing directories without complaints. In my case I include "modules" as one of the elements in the path, but not all test environments has/need that directory. It does not seem useful that users have to filter MODULEPATH on their own before launching rspec.

Checklist

  • 🟢 Spec tests.
  • 🟢 Acceptance tests.
  • Manually verified.

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
@bastelfreak bastelfreak merged commit 3ac5b34 into puppetlabs:main Dec 10, 2023
7 checks passed
@kjetilho kjetilho deleted the modulepath_regression branch December 10, 2023 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants