Hi,
I'm trying to write rspec tests for facts with multiple resolutions.
I know I can stub facts, and thus test all resolutions by targeting them using the stubbed facts.
But how do I test a given resolution if the previous fails?
Or how do I test a given resolution when it was given an explicit weight and no confine statements?
Example:
<code>
Facter.add(:foo) do
has_weight 100
setcode do
"bar"
end
end
Facter.add(:foo) do
has_weight 200
setcode do
nil
end
end
</code>
This fact should return "bar", but how do I test it in rspec?