106
106
RSpec ::Matchers . define :match_gt_field do |expected_pairs , test |
107
107
match do |response |
108
108
expected_pairs . all? do |expected_key , expected_value |
109
-
110
109
split_key = TestFile ::Test . split_and_parse_key ( expected_key ) . collect do |k |
111
110
test . get_cached_value ( k )
112
111
end
128
127
RSpec ::Matchers . define :match_lte_field do |expected_pairs , test |
129
128
match do |response |
130
129
expected_pairs . all? do |expected_key , expected_value |
131
-
132
130
split_key = TestFile ::Test . split_and_parse_key ( expected_key ) . collect do |k |
133
131
test . get_cached_value ( k )
134
132
end
150
148
RSpec ::Matchers . define :match_lt_field do |expected_pairs , test |
151
149
match do |response |
152
150
expected_pairs . all? do |expected_key , expected_value |
153
-
154
151
split_key = TestFile ::Test . split_and_parse_key ( expected_key ) . collect do |k |
155
152
test . get_cached_value ( k )
156
153
end
@@ -302,7 +299,8 @@ def compare_string_response(expected_string, response)
302
299
# Remove surrounding '/' in string representing Regex
303
300
expected_error = expected_error . chomp ( "/" )
304
301
expected_error = expected_error [ 1 ..-1 ] if expected_error =~ /^\/ /
305
- message = actual_error . message . tr ( "\\ " , "" )
302
+
303
+ message = actual_error . message . tr ( '\\' , '' )
306
304
307
305
case expected_error
308
306
when 'request_timeout'
@@ -317,12 +315,12 @@ def compare_string_response(expected_string, response)
317
315
message =~ /\[ 400\] /
318
316
when 'param'
319
317
message =~ /\[ 400\] / ||
320
- actual_error . is_a? ( ArgumentError )
318
+ actual_error . is_a? ( ArgumentError )
321
319
when 'unauthorized'
322
320
actual_error . is_a? ( Elastic ::Transport ::Transport ::Errors ::Unauthorized )
323
321
when 'forbidden'
324
322
actual_error . is_a? ( Elastic ::Transport ::Transport ::Errors ::Forbidden )
325
- when /error parsing field/
323
+ when /error parsing field/ , /illegal_argument_exception/
326
324
message =~ /\[ 400\] / ||
327
325
actual_error . is_a? ( Elastic ::Transport ::Transport ::Errors ::BadRequest )
328
326
when /NullPointerException/
0 commit comments