Closed ffbh123456 closed 2 years ago
here's a similar issue for spy
; https://github.com/Olivine-Labs/busted/issues/578
Maybe the solution can be added to the stub
as well?
@Tieske Hi, I used spy, but I found that his error report is similar to that of stub, and no information about the parameter list is output.
test(
"test",
function()
local test = require "test"
local s = spy.on(test,"fun")
test.fun("i am info msg")
assert.spy(s).called_with("i am info msg11111")
mock.revert(test)
end
)
# Failure message:test.lua:75: Function was not called with the arguments
# stack traceback:
# test.lua:75: in function <test.lua:71>
#
@ZhouJiaZhi that code is not released yet. Have you tried with latest master
?
@Tieske I just reinstalled the latest version of busted, and his error report is still unclear.
The latest release version or the latest Git branch HEAD? How exactly did you install it that you know you have the latest non-versioned master branch?
@ZhouJiaZhi it's like @alerque mentioned; use the lastest version from the Github repo, since the change has not yet been released in a a Busted release.
Try:
git clone https://github.com/Olivine-Labs/busted.git
cd busted
luarocks make
And then test again.
@alerque @Tieske Hi, I will show you the detailed information as follows, 1.I re-git clone the busted warehouse, then uninstall and reinstall
2.my unit test
@ZhouJiaZhi sorry, my mistake, those changes were not made to Busted, but to Luassert. So use the latest master branch of Luassert instead.
@Tieske I do not konw how to install luassert, and what version of luaassert is busted using? Why not set luassert as a busted submodule?
busted has a dependency on luassert, and it will automatically be installed when you install busted. Problem here is that the functionality you want hasn't been released yet.
try this
git clone https://github.com/Olivine-Labs/luassert.git
cd luassert
luarocks remove luassert --force
luarocks make
This should be resolved as both luassert and busted have gotten new releases. If for some reason this still does not work as expected please let us know, but I presume the latest releases should have the code you needed in place now.
The following code reports an error, it prompted that this parameter list does not match, but this information is too little, I think it should output the expected parameter list and the current parameter list, by comparing the parameter list, I can locate the problem more conveniently