test/plugins/job/state_machine_test.rb in rocketjob-3.0.0.rc2 vs test/plugins/job/state_machine_test.rb in rocketjob-3.0.0.rc3
- old
+ new
@@ -27,11 +27,11 @@
@job.requeue!(worker_name)
@job.reload
assert @job.queued?
- assert_equal nil, @job.worker_name
+ assert_nil @job.worker_name
end
end
describe '#requeue' do
it 'requeue jobs from dead workers' do
@@ -41,11 +41,11 @@
@job.start!
assert @job.running?, @job.state
@job.requeue(worker_name)
assert @job.queued?
- assert_equal nil, @job.worker_name
+ assert_nil @job.worker_name
@job.reload
assert @job.running?
assert_equal worker_name, @job.worker_name
end
@@ -74,12 +74,12 @@
@job.start!
@job.fail!
assert @job.failed?
assert exc = @job.exception
assert_equal 'RocketJob::JobException', exc.class_name
- assert_equal nil, exc.message
- assert_equal nil, exc.worker_name
+ assert_nil exc.message
+ assert_nil exc.worker_name
assert_equal [], exc.backtrace
end
it 'fail with exception' do
@job.start!
@@ -105,11 +105,11 @@
assert @job.failed?
assert_equal 'oh no', @job.exception.message
@job.retry!
assert @job.queued?
- assert_equal nil, @job.worker_name
- assert_equal nil, @job.exception
+ assert_nil @job.worker_name
+ assert_nil @job.exception
end
end
end
end