lib/soaspec/template_reader.rb in soaspec-0.3.2 vs lib/soaspec/template_reader.rb in soaspec-0.3.3
- old
+ new
@@ -13,10 +13,14 @@
File.join(*Soaspec.template_folder, template_name)
end
# @param [String] template_name File where template is stored
# @return [String] Body of template after determining test_values
- def render_body(template_name, binding)
+ def render_body(template_name, test_values)
+ test_values = IndifferentHash.new(test_values) # Allow test_values to be either Symbol or String
+ test_values&.each do |key, value|
+ instance_variable_set("@#{key}", value)
+ end
self.template_name = template_name
unless File.exist? file_location
raise "Cannot see file at #{file_location}. "\
"Global folder is '#{Soaspec.template_folder}' and filename is '#{template_name}'"
end