From d07839b3ecbf6d98e9d343223b35c3e58bc7c7a1 Mon Sep 17 00:00:00 2001 From: Harry Bagdi Date: Tue, 11 Sep 2018 16:33:59 -0700 Subject: [PATCH] refactor(tests) remove re-definitions to solve luacheck issues --- spec/02-access_spec.lua | 8 ++++---- spec/03-custom-serve_spec.lua | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/02-access_spec.lua b/spec/02-access_spec.lua index ce8b64d4e2f..38e3f72a7a4 100644 --- a/spec/02-access_spec.lua +++ b/spec/02-access_spec.lua @@ -52,7 +52,7 @@ describe("Plugin: prometheus (access)", function() } }) assert.res_status(200, res) - local res = assert(admin_client:send { + res = assert(admin_client:send { method = "GET", path = "/metrics", }) @@ -60,7 +60,7 @@ describe("Plugin: prometheus (access)", function() assert.matches('kong_http_status{code="200",service="mock-service"} 1', body, nil, true) ngx.sleep(1) - local res = assert(proxy_client:send { + res = assert(proxy_client:send { method = "GET", path = "/status/400", headers = { @@ -69,11 +69,11 @@ describe("Plugin: prometheus (access)", function() }) assert.res_status(400, res) - local res = assert(admin_client:send { + res = assert(admin_client:send { method = "GET", path = "/metrics", }) - local body = assert.res_status(200, res) + body = assert.res_status(200, res) assert.matches('kong_http_status{code="400",service="mock-service"} 1', body, nil, true) end) end) diff --git a/spec/03-custom-serve_spec.lua b/spec/03-custom-serve_spec.lua index 000389f6fca..55e0de9e143 100644 --- a/spec/03-custom-serve_spec.lua +++ b/spec/03-custom-serve_spec.lua @@ -50,7 +50,7 @@ describe("Plugin: prometheus (custom server)",function() assert.res_status(200, res) local client = helpers.http_client("127.0.0.1", 9542) - local res = assert(client:send { + res = assert(client:send { method = "GET", path = "/metrics", })