File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
api-spec-testing/test_file Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -111,8 +111,14 @@ def prepare_arguments(args, test)
111
111
# Find the cached values where the variable name is contained in the arguments.
112
112
if ( cached_values = test . cached_values . keys . select { |k | value =~ /\$ \{ ?#{ k } \} ?/ } )
113
113
cached_values . each do |cached |
114
- # The arguments may contain the variable in the form ${variable} or $variable
115
- value . gsub! ( /\$ \{ ?#{ cached } \} ?/ , test . cached_values [ cached ] . to_s )
114
+ # Arguments can be $variable, ${variable} or a Hash:
115
+ retrieved = test . cached_values [ cached ]
116
+ if retrieved . is_a? ( Hash )
117
+ value = retrieved
118
+ else
119
+ # Regex substitution to replace ${variable} or $variable for the value
120
+ value . gsub! ( /\$ \{ ?#{ cached } \} ?/ , retrieved . to_s )
121
+ end
116
122
end
117
123
args [ key ] = value
118
124
end
You can’t perform that action at this time.
0 commit comments