Skip to content

Commit

Permalink
refactor(tests) remove re-definitions to solve luacheck issues
Browse files Browse the repository at this point in the history
  • Loading branch information
hbagdi committed Sep 12, 2018
1 parent cbc4ab5 commit d07839b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions spec/02-access_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ 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",
})
local body = assert.res_status(200, res)
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 = {
Expand All @@ -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)
2 changes: 1 addition & 1 deletion spec/03-custom-serve_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
})
Expand Down

0 comments on commit d07839b

Please sign in to comment.