diff options
Diffstat (limited to 'spec/defines/rule_spec.rb')
-rw-r--r-- | spec/defines/rule_spec.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/spec/defines/rule_spec.rb b/spec/defines/rule_spec.rb index 7529fce..4b7b1d4 100644 --- a/spec/defines/rule_spec.rb +++ b/spec/defines/rule_spec.rb @@ -1,8 +1,10 @@ +# frozen_string_literal: true + require 'spec_helper' describe 'ferm::rule', type: :define do on_supported_os.each do |os, facts| - context "on #{os} " do + context "on #{os}" do let :facts do facts end @@ -202,12 +204,15 @@ describe 'ferm::rule', type: :define do it { is_expected.to compile.with_all_deps } it { is_expected.to contain_concat__fragment('filter-SSH-policy') } + it do - is_expected.to contain_concat__fragment('INPUT-filter-ssh').\ + expect(subject).to contain_concat__fragment('INPUT-filter-ssh').\ with_content("mod comment comment 'filter-ssh' proto tcp dport 22 jump SSH;\n"). \ that_requires('Ferm::Chain[check-ssh]') end + it { is_expected.to contain_concat__fragment('filter-INPUT-config-include') } + if facts[:os]['name'] == 'Debian' it { is_expected.to contain_concat('/etc/ferm/ferm.d/chains/filter-SSH.conf') } else |