diff options
author | Tim Meusel <tim@bastelfreak.de> | 2021-06-28 13:57:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-28 13:57:40 +0200 |
commit | 6f77a892f58b4955bdd41ac72b422e49502c02fb (patch) | |
tree | 4a36403f3c384b60458189a9ed9bd81518ca4184 | |
parent | c42fe0887ec5b4987d9873a104f60d00a9048806 (diff) | |
parent | c159972ad57df3f499fef17a5fb232d31a6d1f3d (diff) | |
download | puppet-ferm-6f77a892f58b4955bdd41ac72b422e49502c02fb.tar.gz puppet-ferm-6f77a892f58b4955bdd41ac72b422e49502c02fb.tar.bz2 |
Merge pull request #129 from bastelfreak/package
enhance spec coverage
-rw-r--r-- | .fixtures.yml | 1 | ||||
-rw-r--r-- | spec/classes/ferm_spec.rb | 17 |
2 files changed, 16 insertions, 2 deletions
diff --git a/.fixtures.yml b/.fixtures.yml index f2243e6..9e0b188 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -3,3 +3,4 @@ fixtures: repositories: stdlib: 'https://github.com/puppetlabs/puppetlabs-stdlib' concat: 'https://github.com/puppetlabs/puppetlabs-concat' + vcsrepo: 'https://github.com/puppetlabs/puppetlabs-vcsrepo' diff --git a/spec/classes/ferm_spec.rb b/spec/classes/ferm_spec.rb index b134368..4ae75eb 100644 --- a/spec/classes/ferm_spec.rb +++ b/spec/classes/ferm_spec.rb @@ -16,7 +16,7 @@ describe 'ferm' do it { is_expected.to contain_class('ferm::config') } it { is_expected.to contain_class('ferm::service') } it { is_expected.to contain_class('ferm::install') } - it { is_expected.to contain_package('ferm') } + it { is_expected.to contain_package('ferm').with_ensure('latest') } if facts[:os]['name'] == 'Debian' it { is_expected.to contain_file('/etc/ferm/ferm.d') } it { is_expected.to contain_file('/etc/ferm/ferm.d/definitions') } @@ -158,7 +158,6 @@ describe 'ferm' do it { is_expected.to contain_ferm__chain('OUTPUT') } it { is_expected.to contain_ferm__chain('INPUT') } end - context 'it preserves chains' do let :params do { @@ -181,6 +180,20 @@ describe 'ferm' do with_content(%r{chain POSTROUTING @preserve;}) end end + context 'it works with git clone' do + let :params do + { + install_method: 'vcsrepo', + } + end + + it { is_expected.to compile.with_all_deps } + it { is_expected.to contain_package('git').with_ensure('present') } + it { is_expected.to contain_package('iptables').with_ensure('present') } + it { is_expected.to contain_package('perl').with_ensure('present') } + it { is_expected.to contain_package('make').with_ensure('present') } + it { is_expected.to contain_package('ferm').with_ensure('absent') } + end end end end |