voxpupuli / rspec-puppet-facts

Simplify your unit tests by looping on every supported Operating System and populating facts.
Apache License 2.0
61 stars 53 forks source link

Add merge facts option to add_custom_fact #160

Closed jordanbreen28 closed 4 months ago

jordanbreen28 commented 5 months ago

This PR implements a new merge_facts option, which can be used with the add_custom_fact method in your configurations. It allows users to determine whether they want to completely overwrite a fact already present in the facts hash, or simply merge values into the existing fact to expand/overwrite certain values whilst the entirety of the fact.

sample usage: add_custom_fact :identity, { 'user' => "test_user" }, merge_facts: true will update the value of user in the identity fact to "test_user", whilst keeping the rest of the identity fact values the same.

Failing tests rely on the merge of https://github.com/voxpupuli/rspec-puppet-facts/pull/157

codecov[bot] commented 5 months ago

Codecov Report

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

Comparison is base (ec05ede) 95.23% compared to head (d0c9451) 95.34%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #160 +/- ## ========================================== + Coverage 95.23% 95.34% +0.11% ========================================== Files 2 2 Lines 168 172 +4 ========================================== + Hits 160 164 +4 Misses 8 8 ```

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

jordanbreen28 commented 4 months ago

@ekohl @bastelfreak 👋 sorry for the ping.. Does this need anything/any comments? Thanks