aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2025-03-03 18:19:20 +0100
committerWilliam Boman <william@redwill.se>2025-03-03 18:19:20 +0100
commit7e0d8c442ab6e1ec69682d8d1bdaadc4d43a53ee (patch)
tree519664ddab57ccc264a298b42403cab0e32d708c /tests
parentv2.0.0-rc.2 (diff)
downloadmason-7e0d8c442ab6e1ec69682d8d1bdaadc4d43a53ee.tar
mason-7e0d8c442ab6e1ec69682d8d1bdaadc4d43a53ee.tar.gz
mason-7e0d8c442ab6e1ec69682d8d1bdaadc4d43a53ee.tar.bz2
mason-7e0d8c442ab6e1ec69682d8d1bdaadc4d43a53ee.tar.lz
mason-7e0d8c442ab6e1ec69682d8d1bdaadc4d43a53ee.tar.xz
mason-7e0d8c442ab6e1ec69682d8d1bdaadc4d43a53ee.tar.zst
mason-7e0d8c442ab6e1ec69682d8d1bdaadc4d43a53ee.zip
refactor(command): use callback in Package:install() when running :MasonInstall in headless mode
Diffstat (limited to 'tests')
-rw-r--r--tests/mason/api/command_spec.lua14
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/mason/api/command_spec.lua b/tests/mason/api/command_spec.lua
index 6945340d..673e530b 100644
--- a/tests/mason/api/command_spec.lua
+++ b/tests/mason/api/command_spec.lua
@@ -25,8 +25,10 @@ describe(":MasonInstall", function()
spy.on(Pkg, "install")
api.MasonInstall { "dummy@1.0.0", "dummy2" }
assert.spy(Pkg.install).was_called(2)
- assert.spy(Pkg.install).was_called_with(match.is_ref(dummy), { version = "1.0.0" })
- assert.spy(Pkg.install).was_called_with(match.is_ref(dummy2), match.tbl_containing { version = match.is_nil() })
+ assert.spy(Pkg.install).was_called_with(match.is_ref(dummy), { version = "1.0.0" }, match.is_function())
+ assert
+ .spy(Pkg.install)
+ .was_called_with(match.is_ref(dummy2), match.tbl_containing { version = match.is_nil() }, match.is_function())
end)
it("should install provided packages in debug mode", function()
@@ -35,8 +37,12 @@ describe(":MasonInstall", function()
spy.on(Pkg, "install")
vim.cmd [[MasonInstall --debug dummy dummy2]]
assert.spy(Pkg.install).was_called(2)
- assert.spy(Pkg.install).was_called_with(match.is_ref(dummy), { version = nil, debug = true })
- assert.spy(Pkg.install).was_called_with(match.is_ref(dummy2), { version = nil, debug = true })
+ assert
+ .spy(Pkg.install)
+ .was_called_with(match.is_ref(dummy), { version = nil, debug = true }, match.is_function())
+ assert
+ .spy(Pkg.install)
+ .was_called_with(match.is_ref(dummy2), { version = nil, debug = true }, match.is_function())
end)
it("should open the UI window", function()