mirror of
https://github.com/plashchynski/crono.git
synced 2026-02-23 09:04:53 +01:00
30 lines
612 B
Ruby
30 lines
612 B
Ruby
require "spec_helper"
|
|
require 'crono/cli'
|
|
|
|
class TestJob
|
|
def perform;end
|
|
end
|
|
|
|
describe Crono::CLI do
|
|
let(:cli) { Crono::CLI.instance }
|
|
|
|
describe "#run" do
|
|
it "should try to initialize rails with #load_rails and start working loop" do
|
|
expect(cli).to receive(:load_rails)
|
|
expect(cli).to receive(:start_working_loop)
|
|
cli.run
|
|
end
|
|
end
|
|
|
|
describe "#run_job" do
|
|
it "should run job in separate thread" do
|
|
thread = cli.send(:run_job, TestJob).join
|
|
expect(thread).to be_stop
|
|
end
|
|
end
|
|
|
|
describe "#start_working_loop" do
|
|
it "should start working loop"
|
|
end
|
|
end
|