Sha256: e041e9e972cd8e5a972b7ac7dea617be5c62f1e759310763731360dd76266937
Contents?: true
Size: 1.22 KB
Versions: 10
Compression:
Stored size: 1.22 KB
Contents
require File.expand_path("../../spec_helper", __FILE__) module CukeForker describe VncListener do let(:server) { mock(VncTools::Server, :display => ":15") } let(:pool) { mock(VncTools::ServerPool) } let(:worker) { mock(Worker, :data => OpenStruct.new) } let(:listener) { VncListener.new pool } it "fetches a display from the pool and assings it to the worker" do pool.should_receive(:get).and_return(server) worker.data.should_receive(:vnc=).with server listener.on_worker_starting worker end it "releases the display and removes it from the worker" do worker.data.should_receive(:vnc).and_return server pool.should_receive(:release).with server worker.data.should_receive(:vnc=).with(nil) listener.on_worker_finished worker end it "stops the pool when the run finishes" do pool.should_receive(:stop) listener.on_run_finished(true) end it "sets DISPLAY after the worker is forked" do worker.data.should_receive(:vnc).and_return(server) ENV.should_receive(:[]=).with("DISPLAY", ":15") listener.on_worker_forked worker end end # VncListenerServer end # CukeForker
Version data entries
10 entries across 10 versions & 1 rubygems