Refactor sync_environment methods

* Add delete_environment method
* Change return value to allow raising an exception
This commit is contained in:
Sebastian Serth
2021-11-04 01:03:12 +01:00
parent 38e1f5b486
commit ecf470bddd
10 changed files with 106 additions and 31 deletions

View File

@ -233,7 +233,7 @@ describe Runner do
end
it 'raises an error when the environment could not be synced' do
allow(strategy_class).to receive(:sync_environment).with(runner.execution_environment).and_return(false)
allow(strategy_class).to receive(:sync_environment).with(runner.execution_environment).and_raise(Runner::Error::EnvironmentNotFound)
expect { runner.send(:request_new_id) }.to raise_error(Runner::Error::EnvironmentNotFound, /#{environment_id}.*could not be synced/)
end
end