Sha256: 9128e1f1c24f8f290ae604d70bfabffd63d3ee9bb095ce331d449634447690ea
Contents?: true
Size: 1.2 KB
Versions: 3
Compression:
Stored size: 1.2 KB
Contents
require File.expand_path("../../spec_helper", __FILE__) module CukeForker describe VncListener do let(:server) { mock(VncServer, :display => ":15") } let(:pool) { mock(VncServerPool) } 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
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
cukeforker-0.0.9 | spec/cukeforker/vnc_listener_spec.rb |
cukeforker-0.0.8 | spec/cukeforker/vnc_listener_spec.rb |
cukeforker-0.0.7 | spec/cukeforker/vnc_listener_spec.rb |