diff options
author | varac <varacanero@zeromail.org> | 2017-01-16 13:34:48 +0100 |
---|---|---|
committer | varac <varacanero@zeromail.org> | 2017-01-16 13:34:48 +0100 |
commit | f3c4059603a6ac19f132b0dc47b95e49d9ddc4ba (patch) | |
tree | d538ad5f49dc31a3bf10029a2c875b729048cdc0 /spec/defines/tmpfile_spec.rb | |
parent | dc76f6f69e306f865a4a7c3b78b6d5ba694719c5 (diff) | |
parent | a0321364514f52a4c110a15afbdad5109d768fe6 (diff) |
Diffstat (limited to 'spec/defines/tmpfile_spec.rb')
-rw-r--r-- | spec/defines/tmpfile_spec.rb | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/spec/defines/tmpfile_spec.rb b/spec/defines/tmpfile_spec.rb new file mode 100644 index 0000000..4eb22ac --- /dev/null +++ b/spec/defines/tmpfile_spec.rb @@ -0,0 +1,48 @@ +require 'spec_helper' + +describe 'systemd::tmpfile' do + + let(:facts) { { + :path => '/usr/bin', + } } + + context 'default params' do + + let(:title) { 'fancy.conf' } + + it 'creates the tmpfile' do + should contain_file('/etc/tmpfiles.d/fancy.conf').with({ + 'ensure' => 'file', + 'owner' => 'root', + 'group' => 'root', + 'mode' => '0444', + }) + end + + it 'triggers systemd daemon-reload' do + should contain_class('systemd') + should contain_file('/etc/tmpfiles.d/fancy.conf').with_notify("Exec[systemd-tmpfiles-create]") + end + end + + context 'with params' do + let(:title) { 'fancy.conf' } + + let(:params) { { + :ensure => 'absent', + :path => '/etc/tmpfiles.d/foo', + :content => 'some-content', + :source => 'some-source', + } } + + it 'creates the unit file' do + should contain_file('/etc/tmpfiles.d/foo/fancy.conf').with({ + 'ensure' => 'absent', + 'content' => 'some-content', + 'source' => 'some-source', + }) + end + + end + +end |