Change exposed_ports to array

This commit is contained in:
Sebastian Serth
2021-10-17 18:59:03 +02:00
parent 064c55b711
commit 06ef4430f5
13 changed files with 75 additions and 40 deletions

View File

@ -178,17 +178,17 @@ describe ExecutionEnvironment do
end
describe '#exposed_ports_list' do
it 'returns an empty array if no ports are exposed' do
execution_environment.exposed_ports = nil
expect(execution_environment.exposed_ports_list).to eq([])
it 'returns an empty string if no ports are exposed' do
execution_environment.exposed_ports = []
expect(execution_environment.exposed_ports_list).to eq('')
end
it 'returns an array of integers representing the exposed ports' do
execution_environment.exposed_ports = '1,2,3'
expect(execution_environment.exposed_ports_list).to eq([1, 2, 3])
it 'returns an string with comma-separated integers representing the exposed ports' do
execution_environment.exposed_ports = [1, 2, 3]
expect(execution_environment.exposed_ports_list).to eq('1, 2, 3')
execution_environment.exposed_ports_list.each do |port|
expect(execution_environment.exposed_ports).to include(port.to_s)
execution_environment.exposed_ports.each do |port|
expect(execution_environment.exposed_ports_list).to include(port.to_s)
end
end
end