I would start by looking at how the stone itself ( whenever gem ) conducts its tests. This is an excerpt from one of their functional test :
context "weekday at a (single) given time" do
setup do
@output = Whenever.cron \
<<-file
set :job_template, nil
every "weekday", :at => '5:02am' do
command "blahblah"
end
file
end
should "output the command using that time" do
assert_match '2 5 * * 1-5 blahblah', @output
end
end
source
share