Skip to content

Commit

Permalink
Fixed unit tests to stub out ip6tables version.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnytdevops committed Jan 24, 2015
1 parent 82c2917 commit 084da94
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions spec/unit/puppet/type/firewallchain_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,14 @@
end

it 'should generate iptables resources' do
allow(Facter.fact(:ip6tables_version)).to receive(:value).and_return("1.4.21")
resource = Puppet::Type::Firewallchain.new(:name => 'INPUT:filter:IPv4', :purge => true)

expect(resource.generate.size).to eq(3)
end

it 'should not generate ignored iptables rules' do
allow(Facter.fact(:ip6tables_version)).to receive(:value).and_return("1.4.21")
resource = Puppet::Type::Firewallchain.new(:name => 'INPUT:filter:IPv4', :purge => true, :ignore => ['-j fail2ban-ssh'])

expect(resource.generate.size).to eq(2)
Expand Down

0 comments on commit 084da94

Please sign in to comment.