From 14145b31299484cdc21c9e88ff65b7d2d991041d Mon Sep 17 00:00:00 2001 From: Francisco Mejia Date: Tue, 21 Aug 2018 15:07:32 -0400 Subject: [PATCH] Update tests to account for balance() return value --- rootfs/etc/nginx/lua/test/balancer/sticky_test.lua | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/rootfs/etc/nginx/lua/test/balancer/sticky_test.lua b/rootfs/etc/nginx/lua/test/balancer/sticky_test.lua index a3b0d28d9..f484721e2 100644 --- a/rootfs/etc/nginx/lua/test/balancer/sticky_test.lua +++ b/rootfs/etc/nginx/lua/test/balancer/sticky_test.lua @@ -94,10 +94,8 @@ describe("Sticky", function() context("when client doesn't have a cookie set", function() it("should pick an endpoint for the client", function() local sticky_balancer_instance = sticky:new(test_backend) - local ip, port = sticky_balancer_instance:balance() - assert.truthy(ip) - assert.truthy(port) - assert.equal(ip .. ":" .. port, test_backend_endpoint) + local peer = sticky_balancer_instance:balance() + assert.equal(peer, test_backend_endpoint) end) it("should set a cookie on the client", function() @@ -142,10 +140,8 @@ describe("Sticky", function() it("should return the correct endpoint for the client", function() local sticky_balancer_instance = sticky:new(test_backend) - local ip, port = sticky_balancer_instance:balance() - assert.truthy(ip) - assert.truthy(port) - assert.equal(ip .. ":" .. port, test_backend_endpoint) + local peer = sticky_balancer_instance:balance() + assert.equal(peer, test_backend_endpoint) end) end) end)