Update tests to account for balance() return value

This commit is contained in:
Francisco Mejia 2018-08-21 15:07:32 -04:00
parent 86c1b1211c
commit 14145b3129

View file

@ -94,10 +94,8 @@ describe("Sticky", function()
context("when client doesn't have a cookie set", function() context("when client doesn't have a cookie set", function()
it("should pick an endpoint for the client", function() it("should pick an endpoint for the client", function()
local sticky_balancer_instance = sticky:new(test_backend) local sticky_balancer_instance = sticky:new(test_backend)
local ip, port = sticky_balancer_instance:balance() local peer = sticky_balancer_instance:balance()
assert.truthy(ip) assert.equal(peer, test_backend_endpoint)
assert.truthy(port)
assert.equal(ip .. ":" .. port, test_backend_endpoint)
end) end)
it("should set a cookie on the client", function() 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() it("should return the correct endpoint for the client", function()
local sticky_balancer_instance = sticky:new(test_backend) local sticky_balancer_instance = sticky:new(test_backend)
local ip, port = sticky_balancer_instance:balance() local peer = sticky_balancer_instance:balance()
assert.truthy(ip) assert.equal(peer, test_backend_endpoint)
assert.truthy(port)
assert.equal(ip .. ":" .. port, test_backend_endpoint)
end) end)
end) end)
end) end)