File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
api-spec-testing/test_file Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ def execute(client, test = nil)
89
89
when 'catch' , 'warnings' , 'allowed_warnings' , 'allowed_warnings_regex'
90
90
client
91
91
when 'put_trained_model_alias'
92
- args . merge! ( 'reassign' => true ) unless args [ 'reassign' ] === false
92
+ args . merge! ( 'reassign' => true ) unless args [ 'reassign' ] == false
93
93
@response = client . send ( _method , prepare_arguments ( args , test ) )
94
94
client
95
95
else
@@ -119,8 +119,14 @@ def prepare_arguments(args, test)
119
119
# Find the cached values where the variable name is contained in the arguments.
120
120
if ( cached_values = test . cached_values . keys . select { |k | value =~ /\$ \{ ?#{ k } \} ?/ } )
121
121
cached_values . each do |cached |
122
- # The arguments may contain the variable in the form ${variable} or $variable
123
- value . gsub! ( /\$ \{ ?#{ cached } \} ?/ , test . cached_values [ cached ] . to_s )
122
+ # Arguments can be $variable, ${variable} or a Hash:
123
+ retrieved = test . cached_values [ cached ]
124
+ if retrieved . is_a? ( Hash )
125
+ value = retrieved
126
+ else
127
+ # Regex substitution to replace ${variable} or $variable for the value
128
+ value . gsub! ( /\$ \{ ?#{ cached } \} ?/ , retrieved . to_s )
129
+ end
124
130
end
125
131
args [ key ] = value
126
132
end
You can’t perform that action at this time.
0 commit comments