spec/cuboid/rest/server_spec.rb in cuboid-0.1.9.1 vs spec/cuboid/rest/server_spec.rb in cuboid-0.2

- old
+ new

@@ -13,12 +13,12 @@ let(:options) {{}} let(:url) { tpl_url % id } let(:id) { @id } let(:non_existent_id) { 'stuff' } - let(:agent) { Cuboid::Processes::Agents.spawn } - let(:scheduler) { Cuboid::Processes::Schedulers.spawn } + let(:agent) { Cuboid::Processes::Agents.spawn daemonize: true } + let(:scheduler) { Cuboid::Processes::Schedulers.spawn daemonize: true } def create_instance post '/instances', options response_data['id'] end @@ -50,11 +50,11 @@ before do Cuboid::Options.datastore['username'] = username Cuboid::Options.datastore['password'] = password Cuboid::Options.rpc.server_port = Cuboid::Utilities.available_port - Cuboid::Processes::Manager.spawn( :rest_service ) + Cuboid::Processes::Manager.spawn( :rest_service, daemonize: true ) sleep 0.1 while Typhoeus.get( url ).code == 0 end after do @@ -95,11 +95,11 @@ Cuboid::Options.rpc.ssl_ca = ssl_ca Cuboid::Options.rpc.server_ssl_private_key = ssl_key Cuboid::Options.rpc.server_ssl_certificate = ssl_cert Cuboid::Options.rpc.server_port = Cuboid::Utilities.available_port - Cuboid::Processes::Manager.spawn( :rest_service ) + Cuboid::Processes::Manager.spawn( :rest_service, daemonize: true ) sleep 0.1 while Typhoeus.get( url ).return_code == :couldnt_connect end after do @@ -685,11 +685,11 @@ end end end describe 'GET /grid' do - let(:agent) { Cuboid::Processes::Agents.grid_spawn } + let(:agent) { Cuboid::Processes::Agents.grid_spawn daemonize: true } let(:tpl_url) { '/grid' } it 'returns Grid info' do put '/agent/url', agent.url expect(response_code).to eq 200 @@ -707,11 +707,11 @@ end end end describe 'GET /grid/:agent' do - let(:agent) { Cuboid::Processes::Agents.grid_spawn } + let(:agent) { Cuboid::Processes::Agents.grid_spawn daemonize: true } let(:tpl_url) { '/grid/%s' } it 'returns Agent info' do put '/agent/url', agent.url expect(response_code).to eq 200 @@ -733,10 +733,10 @@ end end end describe 'DELETE /grid/:agent' do - let(:agent) { Cuboid::Processes::Agents.grid_spawn } + let(:agent) { Cuboid::Processes::Agents.grid_spawn daemonize: true } let(:tpl_url) { '/grid/%s' } it 'unplugs the Agent from the Grid' do put '/agent/url', agent.url expect(response_code).to eq 200