spec/td/client/model_job_spec.rb in td-client-0.8.82 vs spec/td/client/model_job_spec.rb in td-client-0.8.83

- old
+ new

@@ -95,34 +95,34 @@ thread = Thread.start { job.wait(nil, 0.1, &b) } sleep 0.3 change_job_status(Job::STATUS_SUCCESS) - thread.join(0.5) + thread.join(1) expect(thread).to be_stop ensure thread.kill # just in case end }.to yield_control.at_least(2).at_most(3).times end end context 'with timeout' do context 'the job running time is too long' do - it 'raise ::TimeoutError' do + it 'raise Timeout::Error' do expect { job.wait(0.1) - }.to raise_error(::TimeoutError) + }.to raise_error(Timeout::Error) end end it 'calls a given block in every wait_interval second, and timeout' do expect { |b| begin thread = Thread.start { job.wait(0.3, 0.1, &b) } - expect{ thread.value }.to raise_error(::TimeoutError) + expect{ thread.value }.to raise_error(Timeout::Error) expect(thread).to be_stop ensure thread.kill # just in case end }.to yield_control.at_least(2).times