mirror of
https://github.com/plashchynski/crono.git
synced 2026-04-25 02:08:43 +02:00
Add Job#description
This commit is contained in:
@@ -12,6 +12,10 @@ module Crono
|
||||
period.next(since: last_performed_at)
|
||||
end
|
||||
|
||||
def description
|
||||
"Perform #{performer} #{period.description}"
|
||||
end
|
||||
|
||||
def perform
|
||||
Crono.logger.info "Perform #{performer}"
|
||||
self.last_performed_at = Time.now
|
||||
|
||||
@@ -19,4 +19,10 @@ describe Crono::Job do
|
||||
expect(thread).to be_stop
|
||||
end
|
||||
end
|
||||
|
||||
describe "#description" do
|
||||
it "should return job identificator" do
|
||||
expect(job.description).to be_eql("Perform TestJob every 2 days")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user