Skip to content

Commit 70c0a78

Browse files
committed
[API] Test Runner: Replaces variables for their values in set keys
1 parent 10e8c07 commit 70c0a78

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

api-spec-testing/test_file/task_group.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,9 @@ def set_variable(action)
314314
variables_to_set.each do |set_definition|
315315
set_definition['set'].each do |response_key, variable_name|
316316
nested_key_chain = response_key.split('.').map do |key|
317+
# If there's a variable in the set key, get the value:
318+
key.gsub!(key, @test.cached_values[key.gsub('$', '')]) if key.match?(/\$.+/)
319+
317320
(key =~ /\A[-+]?[0-9]+\z/) ? key.to_i: key
318321
end
319322

0 commit comments

Comments
 (0)