Skip to content

Commit

Permalink
Merge pull request #480 from jonnytpuppet/fix_unit_tests
Browse files Browse the repository at this point in the history
Fixed unit tests to stub out ip6tables version.
  • Loading branch information
cyberious committed Jan 24, 2015
2 parents 82c2917 + 084da94 commit 4fa0976
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 4fa0976

Please sign in to comment.