puppetlabs / ruby-pwsh

A ruby gem for interacting with PowerShell
MIT License
15 stars 23 forks source link

(CAT-1991) - Skip missing dirs invalid_dir method #334

Closed jordanbreen28 closed 3 weeks ago

jordanbreen28 commented 3 weeks ago

Summary

Updates invalid_directories? method in Pwsh::Util to ignore non existent entries for the lib env. Also warn rather than raise when invalid directory is found, this is not a critical error and is overprotective (see internal jira).

Refactored invalid_directories? method, new code removes unnecessary lines and opts for the direct return value of filtered array using a conditional .any? that meets the new requirements of the method.

More unit testing added to cover the new functioanlity.

Additional Context

Add any additional context about the problem here.

Related Issues (if any)

Mention any related issues or pull requests.

Checklist

codecov[bot] commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 92.08%. Comparing base (a6dd0f0) to head (729b60d). Report is 3 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #334 +/- ## ========================================== - Coverage 92.10% 92.08% -0.03% ========================================== Files 6 6 Lines 722 720 -2 ========================================== - Hits 665 663 -2 Misses 57 57 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.