spec/cuboid/rpc/server/scheduler_spec.rb in cuboid-0.0.5 vs spec/cuboid/rpc/server/scheduler_spec.rb in cuboid-0.1.0

- old
+ new

@@ -50,24 +50,24 @@ expect(Cuboid::Processes::Manager.alive?( pid )).to be false end end - context 'when a Dispatcher has been set' do - subject { Cuboid::Processes::Schedulers.spawn dispatcher: dispatcher.url } - let(:dispatcher) do - Cuboid::Processes::Dispatchers.spawn( application: "#{fixtures_path}/mock_app.rb" ) + context 'when a Agent has been set' do + subject { Cuboid::Processes::Schedulers.spawn agent: agent.url } + let(:agent) do + Cuboid::Processes::Agents.spawn( application: "#{fixtures_path}/mock_app.rb" ) end it 'gets Instances from it' do - expect(dispatcher.finished_instances).to be_empty + expect(agent.finished_instances).to be_empty subject.push( options ) sleep 0.1 while subject.completed.empty? sleep 2 - expect(dispatcher.finished_instances).to be_any + expect(agent.finished_instances).to be_any end it 'sets OptionGroups::Scheduler#url' do id = subject.push( options ) sleep 0.1 while subject.running.empty? @@ -78,19 +78,19 @@ context 'but becomes unavailable' do it 'does not consume the queue' do subject - Cuboid::Processes::Dispatchers.killall + Cuboid::Processes::Agents.killall sleep 3 expect(subject.size).to be 0 subject.push( options ) sleep 5 expect(subject.size).to be 1 - expect(subject.errors.join("\n")).to include "Failed to contact Dispatcher at: #{dispatcher.url}" + expect(subject.errors.join("\n")).to include "Failed to contact Agent at: #{agent.url}" end end end describe '#alive?' do