spec/lita/handlers/jobs_spec.rb in lita-jobs-0.0.2 vs spec/lita/handlers/jobs_spec.rb in lita-jobs-0.0.3
- old
+ new
@@ -34,11 +34,11 @@
it { routes('jobs out 232').to(:job_output) }
it { doesnt_route('jobs wadus').to(:job_list) }
shared_examples_for 'prints error message when job not found' do
it 'returns error message when not found' do
- allow(Yajm::JobManager).to receive(:getjob).with('1123')
+ allow(Yajm::JobManager).to receive(:getjob).with(1123)
send_command('jobs tail 1123')
expect(replies.last).to eq('No such job: 1123')
end
end
@@ -62,22 +62,22 @@
end
end
describe '#job_kill' do
it 'kills a jobs when found' do
- allow(Yajm::JobManager).to receive(:getjob).with('1123').and_return(job)
+ allow(Yajm::JobManager).to receive(:getjob).with(1123).and_return(job)
expect(job).to receive(:kill!)
send_command('jobs kill 1123')
end
it_behaves_like 'prints error message when job not found'
end
describe '#job_tail' do
it 'gets last output from a job when found' do
output = 'Hello world!'
- allow(Yajm::JobManager).to receive(:getjob).with('1123').and_return(job)
+ allow(Yajm::JobManager).to receive(:getjob).with(1123).and_return(job)
allow(job).to receive(:output_tail).and_return(output)
send_command('jobs tail 1123')
expect(replies.last).to eq(output)
end
@@ -85,10 +85,10 @@
end
describe '#job_output' do
it 'gets output from a job when found' do
output = "I'm Muzzy big Muzzy"
- allow(Yajm::JobManager).to receive(:getjob).with('1123').and_return(job)
+ allow(Yajm::JobManager).to receive(:getjob).with(1123).and_return(job)
allow(job).to receive(:output).and_return(output)
send_command('jobs output 1123')
expect(replies.last).to eq(output)
end