Add CLI#run_job

This commit is contained in:
Dzmitry Plashchynski
2015-03-03 14:36:00 +02:00
parent 5efd2681d0
commit 2c78115ce7
3 changed files with 24 additions and 2 deletions

View File

@@ -1,6 +1,10 @@
require "spec_helper"
require 'crono/cli'
class TestJob
def perform;end
end
describe Crono::CLI do
let(:cli) { Crono::CLI.instance }
@@ -10,4 +14,11 @@ describe Crono::CLI do
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
end