Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def self.test_release(alpha_client, release, test_devices, test_cases, username
end
end

device_executions = string_to_array(test_devices, ';').map do |td_string|
device_executions = string_to_array(test_devices, /[;\n]/).map do |td_string|
td_hash = parse_test_device_string(td_string)
Google::Apis::FirebaseappdistributionV1alpha::GoogleFirebaseAppdistroV1alphaDeviceExecution.new(
device: Google::Apis::FirebaseappdistributionV1alpha::GoogleFirebaseAppdistroV1alphaTestDevice.new(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def get_value_from_value_or_file(value, path)

# Returns the array representation of a string with trimmed comma
# seperated values.
def string_to_array(string, delimiter = ",")
def string_to_array(string, delimiter = /[,\n]/)
return [] if string.nil?
# Strip string and then strip individual values
string.strip.split(delimiter).map(&:strip)
Expand Down
10 changes: 10 additions & 0 deletions spec/firebase_app_distribution_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@
array = helper.string_to_array(" ")
expect(array).to eq([])
end

it 'returns an array when the string is seperated by newlines' do
array = helper.string_to_array("string1\n string2 \nstring3\n")
expect(array).to eq(%w[string1 string2 string3])
end

it 'returns an array when the string is seperated by semicolons and/or newlines when asked to do so' do
array = helper.string_to_array("string1;string2\nstring3\n", /[;\n]/)
expect(array).to eq(%w[string1 string2 string3])
end
end

describe '#get_ios_app_id_from_archive_plist' do
Expand Down
Loading