templates/test_spec.rb.erb in onceover-3.10.0 vs templates/test_spec.rb.erb in onceover-3.10.1

- old
+ new

@@ -47,10 +47,17 @@ <% if @mock_functions -%> <% require 'json' -%> # Mocking functions <% @mock_functions.each do |function,params| -%> -function <%= function %> (*$args) { from_json('<%= params['returns'].to_json %>') } +<% if params['returns'].is_a? String -%> +<% require 'pry' -%> +<% binding.pry -%> +<% json = params['returns'].dump[1..-2].to_json -%> +<% else -%> +<% json = params['returns'].to_json -%> +<% end -%> +function <%= function %> (*$args) { from_json('<%= json %>') } <% end -%> <% end -%> END }