I'm trying to set up a cronjob to run a command (in this example ls
) once every day. For this I am using the cron resource.
The problem is that I don't know how to test it with Inspect. I tried using crontab but it's not working.
Here's the code:
// code
cron 'my-ls' do
minute '1'
hour '0'
command 'ls'
end
// test
describe crontab.commands('ls') do
its('minutes') { should cmp '1' }
its('hours') { should cmp '0' }
end
It's failing saying that:
× hours should cmp == "0"
expected: "0"
got: []
(compared using `cmp` matcher)
× minutes should cmp == "1"
expected: "1"
got: []
(compared using `cmp` matcher)
PS: I also tried with cron_d
using the cron cookbook