Add ale.has to mirror ale#Has in Lua

This commit is contained in:
w0rp
2025-03-22 00:04:46 +00:00
parent bd591d47f2
commit ecf815891d
3 changed files with 40 additions and 1 deletions

27
test/lua/ale_has_spec.lua Normal file
View File

@@ -0,0 +1,27 @@
local eq = assert.are.same
local ale = require("ale")
describe("ale.has", function()
setup(function()
_G.vim = {
fn = {
["ale#Has"] = function(feature)
if feature == "ale-4.0.0" then
return 1
end
return 0
end,
},
}
end)
teardown(function()
_G.vim = nil
end)
it("should return valuse from ale#Has correctly", function()
eq(true, ale.has("ale-4.0.0"))
eq(false, ale.has("ale-20.0.0"))
end)
end)