Skip to content

Commit

Permalink
Remove broken spec that should not have been committed
Browse files Browse the repository at this point in the history
  • Loading branch information
betamatt committed Sep 23, 2010
1 parent 1fea4b0 commit 92d7e31
Showing 1 changed file with 0 additions and 51 deletions.
51 changes: 0 additions & 51 deletions spec/worker_spec.rb
Expand Up @@ -34,55 +34,4 @@
lambda { Delayed::Worker.guess_backend }.should_not change { Delayed::Worker.backend }
end
end

describe "running a job" do
before(:each) do
@worker = Delayed::Worker.new
end

after(:each) do
Delayed::Job.delete_all
end

describe 'that fails' do
before(:each) do
@handler = ErrorJob.new
@job = Delayed::Job.enqueue(@handler)
end

it 'should increase the attempts' do
@worker.run(@job)
@job.attempts.should == 1
end

it 'should reschedule the job in the future' do
@worker.run(@job)
@job.run_at.should > Job.db_time_now + 5
end

describe 'with custom rescheduling strategy' do
before(:each) do
@reschedule_at = Time.current + 7.hours
@handler.stub!(:reschedule_at).and_return(@reschedule_at)
end

it 'should invoke the strategy' do
@handler.should_receive(:reschedule_at) do |time, attempts|
(Job.db_time_now - time).should < 2
attempts.should == 1

Job.db_time.now + 5
end

@worker.run(@job)
end

end

it 'should reschedule at the specified time' do
@worker.run(@job)
@job.run_at.should == @reschedule_at
end
end
end
end

0 comments on commit 92d7e31

Please sign in to comment.