Without a stub some tests fail on non-Linux hosts. This is because they are
expecting a particular version of iptables to exist which isn't always true.
The right answer for the provider is to actually allow the fact to be set
per test, but for now we are doing a global override just to make tests pass.
before :each do
Puppet::Type::Firewall.stubs(:defaultprovider).returns provider
provider.stubs(:command).with(:iptables_save).returns "/sbin/iptables-save"
+
+ # Stub iptables version
+ Facter.fact(:iptables_version).stubs(:value).returns("1.4.2")
end
it 'should be able to get a list of existing rules' do
Puppet::Type::Firewall.stubs(:defaultprovider).returns @provider
@resource = @class.new({:name => '000 test foo'})
+
+ # Stub iptables version
+ Facter.fact(:iptables_version).stubs(:value).returns("1.4.2")
end
it 'should have :name be its namevar' do