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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a279ed35dcdcebb3992365f237f70fd6c1c9d8ee49e71d622d74a76280832203
4
- data.tar.gz: 3d7e8fd20126eda08aa0e452d4dd2806a143a9fa1a227206c157e7b42090406b
3
+ metadata.gz: d09d996ce00f24cbdd34e54d447eff53c19a0a023fa55a61043a5215626e21a8
4
+ data.tar.gz: 77fc59d5846f32c165dcb3ac72bf475c0e572a12f03e7aab80a85030b6e6d7c0
5
5
  SHA512:
6
- metadata.gz: af99ab6771f0dd2b94d600ef119c420e8a43ac06a7e06d5dc4414e31bb9ee96377689a52a98652db8069bd9a5181b892c11c973e186e868d44b020445d604175
7
- data.tar.gz: dd69419f48f9f895e9d9d2646e210f0746a5696d29f4695c3066988106590fa493dd89e98e57022be38c5e110a4c12b05e62e3eb582f2b1f2907842acc8923ab
6
+ metadata.gz: 69587a3c06c098c03c74e2b26f114228012ee97d73267a5623e44e0d689e776d0c9dc85a1cc503a0ac397c68d9939c338bd6a88bcaf0ffacf2cbf77a31d0cc17
7
+ data.tar.gz: 4b4e6315e953fbc534b8fdbc06db5462e7656cee80c1f5edfbd21cbede0956513e2f7d45faff87c77b5cf61a34526d89d9a9b907d4887ff8e9d4cbf4258b6b1b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.8.0] - 2024-08-14
4
+
5
+ - Adds support for variable keys (`$`).
6
+
3
7
  ## [0.7.0] - 2024-08-08
4
8
 
5
9
  - Improves test (file) name display
@@ -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 document.is_a?(Hash)
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]]
@@ -19,6 +19,6 @@
19
19
 
20
20
  module Elasticsearch
21
21
  module Tests
22
- VERSION = '0.7.0'
22
+ VERSION = '0.8.0'
23
23
  end
24
24
  end
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.7.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-08 00:00:00.000000000 Z
11
+ date: 2024-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: elasticsearch