Skip to content

Commit

Permalink
add tests for daemon_group variable
Browse files Browse the repository at this point in the history
  • Loading branch information
miksercz committed Oct 24, 2017
1 parent 644cca5 commit 11e94f4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/classes/nginx_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,12 @@
value: false,
notmatch: %r{user}
},
{
title: 'should not set group',
attr: 'daemon_group',
value: :undef,
notmatch: %r{^user \S+ \S+;}
},
{
title: 'should set user',
attr: 'daemon_user',
Expand Down Expand Up @@ -1074,6 +1080,12 @@
it { is_expected.to contain_file('/etc/nginx/nginx.conf').with_content %r{^user www-data;} }
end

context 'when daemon_group = test-group' do
let(:params) { { daemon_group: 'test-group' } }

it { is_expected.to contain_file('/etc/nginx/nginx.conf').with_content %r{^user .* test-group;} }
end

context 'when log_dir is non-default' do
let(:params) { { log_dir: '/foo/bar' } }

Expand Down

0 comments on commit 11e94f4

Please sign in to comment.