Skip to content

Commit

Permalink
Test setting owner and group
Browse files Browse the repository at this point in the history
Co-Authored-By: gdubicki <[email protected]>
  • Loading branch information
danquack and gdubicki authored Nov 5, 2018
1 parent 5dd598e commit f3f5005
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions spec/defines/dotfile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,20 @@
it { is_expected.to contain_exec('create /home/someuser/.pip/pip.conf\'s parent dir').with_command('install -o root -g root -d /home/someuser/.pip') }
it { is_expected.to contain_file('/home/someuser/.pip/pip.conf').with_mode('0644') }
end
context 'succeeds when set owner' do
let(:title) { '/home/someuser/.pip/pip.conf' }
let(:params) { {'owner': 'someuser' } }

it { is_expected.to contain_exec('create /home/someuser/.pip/pip.conf\'s parent dir').with_command('install -o someuser -g root -d /home/someuser/.pip') }
it { is_expected.to contain_file('/home/someuser/.pip/pip.conf').with_owner('someuser') }
end
context 'succeeds when set group set' do
let(:title) { '/home/someuser/.pip/pip.conf' }
let(:params) { {'group': 'somegroup' } }

it { is_expected.to contain_exec('create /home/someuser/.pip/pip.conf\'s parent dir').with_command('install -o root -g somegroup -d /home/someuser/.pip') }
it { is_expected.to contain_file('/home/someuser/.pip/pip.conf').with_group('somegroup') }
end
end
end
end
Expand Down

0 comments on commit f3f5005

Please sign in to comment.