Details
-
Bug
-
Status: Accepted
-
Normal
-
Resolution: Unresolved
-
FACT 3.6.6
-
None
-
None
-
Platform OS
-
Customer Feedback
-
Needs Assessment
Description
Calling Facter.flush to clear out resolved values during unit testing does not seem to work in Facter 3.6. Facter.clear does, but then affects the ability to get correct coverage reports from tools like SimpleCov, as Facter.clear reloads the entire fact, not just clearing the value.
I have put a very simple reproducer here: https://github.com/seanmil/facter_flush_reproducer
If you run it initially with Facter 3.6.6 two of the tests fail, due to Facter.flush not clearing out a previously resolved value from the prior test run.
If you then uncomment gem 'facter' from the Gemfile and re-run it with Facter 2.5.1 available all tests pass, showing Facter.flush working as expected.