Skip to content
Snippets Groups Projects
Unverified Commit 4efc0d99 authored by Mattt Zmuda's avatar Mattt Zmuda
Browse files

Fix failing test

Coallesce nil to -1 for call to String#index
parent f0c9ec1f
No related branches found
No related tags found
No related merge requests found
...@@ -347,7 +347,7 @@ module Azure::Storage::Common ...@@ -347,7 +347,7 @@ module Azure::Storage::Common
def parse_connection_string(connection_string) def parse_connection_string(connection_string)
opts = {} opts = {}
connection_string.split(";").each do |i| connection_string.split(";").each do |i|
e = i.index("=") e = i.index("=") || -1
raise InvalidConnectionStringError, Azure::Storage::Common::Core::SR::INVALID_CONNECTION_STRING if e < 0 || e == i.length - 1 raise InvalidConnectionStringError, Azure::Storage::Common::Core::SR::INVALID_CONNECTION_STRING if e < 0 || e == i.length - 1
key, value = i[0..e - 1], i[e + 1..i.length - 1] key, value = i[0..e - 1], i[e + 1..i.length - 1]
raise InvalidConnectionStringError, Azure::Storage::Common::Core::SR::INVALID_CONNECTION_STRING_BAD_KEY % key unless ClientOptions.connection_string_mapping.key? key raise InvalidConnectionStringError, Azure::Storage::Common::Core::SR::INVALID_CONNECTION_STRING_BAD_KEY % key unless ClientOptions.connection_string_mapping.key? key
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment