Call Job#load on every Scheduler#add_job call

This commit is contained in:
Dzmitry Plashchynski
2015-03-06 23:48:34 +02:00
parent 78b1d8d6e1
commit c8a4189fd4
2 changed files with 9 additions and 0 deletions

View File

@@ -15,6 +15,14 @@ describe Crono::Scheduler do
@scheduler.jobs = @jobs
end
describe "#add_job" do
it "should call Job#load on Job" do
@job = Crono::Job.new(TestJob, Crono::Period.new(10.day, at: "04:05"))
expect(@job).to receive(:load)
@scheduler.add_job(@job)
end
end
describe "#next" do
it "should return next job in schedule" do
expect(@scheduler.next).to be @jobs[1]