Skip to content

Commit

Permalink
Actualy use the ensure parameter for mailhost resource to provide abs…
Browse files Browse the repository at this point in the history
…ent support.

Corretly test that concat resource parameter ensure is absent.
  • Loading branch information
qs5779 committed Jul 16, 2020
1 parent 27b61fb commit 20da819
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions manifests/resource/mailhost.pp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
}

concat { $config_file:
ensure => $ensure,
owner => 'root',
group => $root_group,
mode => $nginx::global_mode,
Expand Down
7 changes: 7 additions & 0 deletions spec/defines/resource_mailhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@
it { is_expected.not_to contain_concat__fragment("#{title}-ssl") }
end

describe 'absent assumption' do
let(:params) { default_params.merge('ensure'.to_sym => 'absent') }

it { is_expected.to contain_class('nginx') }
it { is_expected.to contain_concat("/etc/nginx/conf.mail.d/#{title}.conf").with('ensure' => 'absent') }
end

describe 'mailhost template content' do
[
{
Expand Down

0 comments on commit 20da819

Please sign in to comment.