Currently assert:remove_formatter(formatter) does not actually do anything because it compares existing formatters with an undefined variable instead of the argument.
Testcase:
$ cat testcase_spec.lua
local binstring = require("luassert.formatters.binarystring")
describe("Tests using a binary string formatter", function()
setup(function()
assert:add_formatter(binstring)
end)
teardown(function()
assert:remove_formatter(binstring)
end)
it("tests a string comparison with binary formatting", function()
local s1, s2 = "", ""
for n = 65,88 do
s1 = s1 .. string.char(n)
s2 = string.char(n) .. s2
end
assert.are.same(s1, s2)
end)
end)
describe("Tests not using a formatter", function()
it("tests a string comparison without binary formatting", function()
local s1, s2 = "", ""
for n = 65,88 do
s1 = s1 .. string.char(n)
s2 = string.char(n) .. s2
end
assert.are.same(s1, s2)
end)
end)
Currently
assert:remove_formatter(formatter)
does not actually do anything because it compares existing formatters with an undefined variable instead of the argument.Testcase:
Before fix:
After fix: