elasticsearch-test-runner 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/elasticsearch/tests/code_runner.rb +5 -5
- data/lib/elasticsearch/tests/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d09d996ce00f24cbdd34e54d447eff53c19a0a023fa55a61043a5215626e21a8
|
4
|
+
data.tar.gz: 77fc59d5846f32c165dcb3ac72bf475c0e572a12f03e7aab80a85030b6e6d7c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69587a3c06c098c03c74e2b26f114228012ee97d73267a5623e44e0d689e776d0c9dc85a1cc503a0ac397c68d9939c338bd6a88bcaf0ffacf2cbf77a31d0cc17
|
7
|
+
data.tar.gz: 4b4e6315e953fbc534b8fdbc06db5462e7656cee80c1f5edfbd21cbede0956513e2f7d45faff87c77b5cf61a34526d89d9a9b907d4887ff8e9d4cbf4258b6b1b
|
data/CHANGELOG.md
CHANGED
@@ -176,13 +176,11 @@ module Elasticsearch
|
|
176
176
|
# Given a key coming from a test definition, search the response body for a matching value.
|
177
177
|
#
|
178
178
|
def search_in_response(keys)
|
179
|
-
if (match = /\$([a-z]+)/.match(keys))
|
180
|
-
return @response.send(match[1])
|
181
|
-
end
|
182
|
-
|
183
179
|
if keys.include?('.')
|
184
180
|
key = split_and_parse_key(keys)
|
185
181
|
return find_value_in_document(key, @response.body)
|
182
|
+
elsif (match = /\$([a-z]+)/.match(keys))
|
183
|
+
return @response.send(match[1])
|
186
184
|
end
|
187
185
|
|
188
186
|
@response[keys]
|
@@ -217,7 +215,9 @@ module Elasticsearch
|
|
217
215
|
return document[chain[0]] unless chain.size > 1
|
218
216
|
|
219
217
|
# a number can be a string key in a Hash or indicate an element in a list
|
220
|
-
if
|
218
|
+
if chain[0].is_a?(String) && chain[0].match?(/^\$/)
|
219
|
+
find_value_in_document(chain[1..], instance_variable_get("@#{chain[0].gsub('$', '')}"))
|
220
|
+
elsif document.is_a?(Hash)
|
221
221
|
find_value_in_document(chain[1..], document[chain[0].to_s]) if document[chain[0].to_s]
|
222
222
|
elsif document[chain[0]]
|
223
223
|
find_value_in_document(chain[1..], document[chain[0]]) if document[chain[0]]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elasticsearch-test-runner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic Client Library Maintainers
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: elasticsearch
|