spec/debian/commands_spec.rb in serverspec-0.4.1 vs spec/debian/commands_spec.rb in serverspec-0.4.2

- old
+ new

@@ -140,11 +140,18 @@ subject { commands.check_grouped('/etc/passwd', 'wheel') } it { should eq 'stat -c %G /etc/passwd | grep -- \\^wheel\\$' } end describe 'check_cron_entry' do - subject { commands.check_cron_entry('root', '* * * * * /usr/local/bin/batch.sh') } - it { should eq 'crontab -u root -l | grep -- \\\\\\*\\ \\\\\\*\\ \\\\\\*\\ \\\\\\*\\ \\\\\\*\\ /usr/local/bin/batch.sh' } + context 'specify root user' do + subject { commands.check_cron_entry('root', '* * * * * /usr/local/bin/batch.sh') } + it { should eq 'crontab -u root -l | grep -- \\\\\\*\\ \\\\\\*\\ \\\\\\*\\ \\\\\\*\\ \\\\\\*\\ /usr/local/bin/batch.sh' } + end + + context 'no specified user' do + subject { commands.check_cron_entry(nil, '* * * * * /usr/local/bin/batch.sh') } + it { should eq 'crontab -l | grep -- \\\\\\*\\ \\\\\\*\\ \\\\\\*\\ \\\\\\*\\ \\\\\\*\\ /usr/local/bin/batch.sh' } + end end describe 'check_link' do subject { commands.check_link('/etc/system-release', '/etc/redhat-release') } it { should eq 'stat -c %N /etc/system-release | grep -- /etc/redhat-release' }