diff --git a/spec/helpers/http_mock/nginx_instance.lua b/spec/helpers/http_mock/nginx_instance.lua index f27917bd5ba2..50b926ef9944 100644 --- a/spec/helpers/http_mock/nginx_instance.lua +++ b/spec/helpers/http_mock/nginx_instance.lua @@ -14,9 +14,16 @@ local error = error local assert = assert local ngx = ngx local io = io --- It can't be changed to kong.tools.table because the old version --- does not have kong/tools/table.lua, so the upgrade test will fail. -local shallow_copy = require("kong.tools.utils").shallow_copy + +local shallow_copy +do + local clone = require "table.clone" + + shallow_copy = function(orig) + assert(type(orig) == "table") + return clone(orig) + end +end local template = assert(pl_template.compile(template_str)) local render_env = {ipairs = ipairs, pairs = pairs, error = error, }