Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Resque::Scheduler.print_schedule #794

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/resque/scheduler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ def print_schedule
if rufus_scheduler
log! "Scheduling Info\tLast Run"
scheduler_jobs = rufus_scheduler.jobs
scheduler_jobs.each do |_k, v|
log! "#{v.t}\t#{v.last}\t"
scheduler_jobs.each do |job|
log! "#{job.opts}\t#{job.last_time}\t"
end
end
end
Expand Down
12 changes: 6 additions & 6 deletions test/scheduler_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -589,15 +589,15 @@ def enqueue_started!

context 'printing schedule' do
setup do
Resque::Scheduler.expects(:log!).at_least_once
Resque::Scheduler.stubs(:log!)
end

test 'prints schedule' do
fake_rufus_scheduler = mock
fake_rufus_scheduler.expects(:jobs).at_least_once
.returns(foo: OpenStruct.new(t: nil, last: nil))
Resque::Scheduler.expects(:rufus_scheduler).at_least_once
.returns(fake_rufus_scheduler)
rufus_scheduler = Rufus::Scheduler.new
fake_job = rufus_scheduler.at(Time.now + 1, job: true) {}
Resque::Scheduler.expects(:rufus_scheduler).at_least_once.returns(rufus_scheduler)
Resque::Scheduler.expects(:log!).with("#{fake_job.opts}\t#{fake_job.last_time}\t")

Resque::Scheduler.print_schedule
end
end
Expand Down
Loading