Ошибка TypeError: нет явного преобразования nil в String - PullRequest
0 голосов
/ 22 сентября 2018

Следующий код возвращает ошибку (TypeError: no implicit conversion of nil into String) в последней строке:

And(/^the user makes the following changes in the response file "(.*)" and creates a uri with "(.*)" and wskey:$/) do |readFile, strURI,table|

  strRequestBody = $objFileIO.ReadFile(STR_FILE_SPEC + '/response/' + readFile)
  table.hashes.each do |rows|
    @request_uri = strRequestBody.gsub!(/#{rows[:parameter_in_response]}/, rows[:replace_with])
  end

  puts "this is url" + @request_uri   
end

1 Ответ

0 голосов
/ 27 сентября 2018

Просто определите его вне цикла, тогда совок изменится.

...