Skip to content

Commit 728e06b

Browse files
committed
Fixes bad range value error
1 parent 3c50de6 commit 728e06b

File tree

1 file changed

+7
-2
lines changed
  • elasticsearch-xpack/spec/support/test_file

1 file changed

+7
-2
lines changed

elasticsearch-xpack/spec/support/test_file/test.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,7 @@ def skip_version?(client, skip_definition)
173173
return true if skip_definition['version'] == 'all'
174174
range_partition = /\s*-\s*/
175175
if versions = skip_definition['version'] && skip_definition['version'].partition(range_partition)
176-
low = versions[0]
177-
high = versions[2] unless versions[2] == ''
176+
low, high = __parse_versions(versions)
178177
range = low..high
179178
begin
180179
server_version = client.info['version']['number']
@@ -192,6 +191,12 @@ def is_a_validation?(action)
192191
def expects_exception?(action)
193192
action['do'] && action['do']['catch']
194193
end
194+
195+
def __parse_versions(versions)
196+
low = versions[0]
197+
high = (['', nil, '-'].include? versions[2]) ? low : versions[2]
198+
[low, high]
199+
end
195200
end
196201
end
197202
end

0 commit comments

Comments
 (0)