replace variables
Json data = Json.emptyObject; data["one"] = "1"; data["second"] = Json.emptyObject; data["second"]["value"] = "2"; "#{one}-#{second.value}".replaceVariables(data).should.startWith("1-"); "#{one}-#{second.value}".replaceVariables(data).should.endWith("-2");
should not replace variables on undefined data
Json data; "#{one}-#{second.value}".replaceVariables(data).should.startWith("#{one}-"); "#{one}-#{second.value}".replaceVariables(data).should.endWith("-#{second.value}");
Search variables #{variable_name} and replace them with the values from json