spec/jcukeforker/runner_spec.rb in jcukeforker-0.2.5 vs spec/jcukeforker/runner_spec.rb in jcukeforker-0.2.6
- old
+ new
@@ -13,12 +13,12 @@
listeners = [double(AbstractListener, :update => nil)]
log = false
features = %w[a b]
delay = 1
- mock_task_manager = double(TaskManager, :update => nil)
- mock_status_server = double(StatusServer)
+ mock_task_manager = double(TaskManager, :update => nil, :has_failures? => false)
+ mock_status_server = double(StatusServer, :port => nil)
mock_tasks = Array.new(2) { |n| double("Worker-#{n}") }
TaskManager.should_receive(:new).with(features, {format: format, out: out, extra_args: []}).and_return mock_task_manager
StatusServer.should_receive(:new).with('6333').and_return mock_status_server
@@ -50,10 +50,12 @@
let(:status_server0) { double(StatusServer, :run => nil) }
let(:status_server) { double(StatusServer, :async => status_server0, :shutdown => nil) }
let(:process) { double(ChildProcess, :start => nil, :wait => nil) }
let(:work_dir) { '/tmp/jcukeforker-testdir' }
let(:vnc_pool) { double(VncTools::ServerPool, :stop => nil) }
- let(:runner) { Runner.new(status_server, [process], work_dir, vnc_pool, 0) }
+ let(:mock_task_manager) { double(TaskManager, :update => nil, :has_failures? => false) }
+ let(:runner) { Runner.new(status_server, [process], work_dir, vnc_pool, 0, mock_task_manager) }
+
it "processes the queue" do
runner.add_observer listener
listener.should_receive(:update).with(:on_run_starting)