As a heads up I'm working on a refactor that'll do something like this: https://github.com/adrienthebo/facter/commit/de066d75b6717d52c46faadd06843cd2145e9471 which should be easier to test.