Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Unpack returned responses from capture_multi

  • Loading branch information...
commit 1257e08b0e18ddfbcd781c9303ef0bb71d2140a0 1 parent 8c3d65a
@dolzenko dolzenko authored
Showing with 6 additions and 1 deletion.
  1. +1 −1  fakengx.lua
  2. +5 −0 spec/fakengx_spec.lua
View
2  fakengx.lua
@@ -280,7 +280,7 @@ function fakengx.new()
for i, request in ipairs(requests) do
table.insert(responses, ngx.location.capture(request[1], request[2]))
end
- return responses
+ return unpack(responses)
end
-- Stub a capture
View
5 spec/fakengx_spec.lua
@@ -163,6 +163,11 @@ context('fakengx', function()
assert_not_error(function() ngx.location.capture_multi({ { "/stubbed" }, { "/stubbed2"} }) end)
assert_equal(#s1.calls, 1)
assert_equal(#s2.calls, 1)
+
+ local r1, r2
+ r1, r2 = ngx.location.capture_multi({ { "/stubbed" }, { "/stubbed2"} })
+ assert_equal(r1.body, 'OK')
+ assert_equal(r2.body, 'OK')
end)
end)
Please sign in to comment.
Something went wrong with that request. Please try again.