This allows assert functions to be passed as arguments and called multiple times using the same table instance.
For example:
describe('Test using asserts passed to function', function()
local function check_values(check, value, t)
for _,v in ipairs(t) do
check(value, v)
end
end
it('check values in table', function()
check_values(assert.is_equal, 5, {5, 5, 5})
check_values(assert.is_not_equal, 0, {1, 2, 3})
end)
end)
This allows assert functions to be passed as arguments and called multiple times using the same table instance.
For example: