Fix crash when no jobs defined

This commit is contained in:
Dzmitry Plashchynski
2016-09-22 18:24:46 +03:00
parent 63c52896f7
commit e7df4bb067
2 changed files with 13 additions and 8 deletions

View File

@@ -7,6 +7,7 @@ describe Crono::CLI do
describe '#run' do
it 'should initialize rails with #load_rails and start working loop' do
expect(cli).to receive(:load_rails)
expect(cli).to receive(:have_jobs?).and_return(true)
expect(cli).to receive(:start_working_loop)
expect(cli).to receive(:parse_options)
expect(cli).to receive(:parse_command)
@@ -14,12 +15,13 @@ describe Crono::CLI do
expect(Crono::Cronotab).to receive(:process)
cli.run
end
context 'should run as daemon' do
before {cli.config.daemonize = true}
context 'should run as daemon' do
before { cli.config.daemonize = true }
it 'should initialize rails with #load_rails and start working loop' do
expect(cli).to receive(:load_rails)
expect(cli).to receive(:have_jobs?).and_return(true)
expect(cli).to receive(:start_working_loop_in_daemon)
expect(cli).to receive(:parse_options)
expect(cli).to receive(:parse_command)