aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-07-22 18:26:23 +0200
committerGitHub <noreply@github.com>2022-07-22 18:26:23 +0200
commit1e3c60c46ab32416df56e7c19b4475afd5abe186 (patch)
tree215da41bcebcb3b81984a393341e7f74844393dc /tests
parentdocs: fixup the mason.txt help (#115) (diff)
downloadmason-1e3c60c46ab32416df56e7c19b4475afd5abe186.tar
mason-1e3c60c46ab32416df56e7c19b4475afd5abe186.tar.gz
mason-1e3c60c46ab32416df56e7c19b4475afd5abe186.tar.bz2
mason-1e3c60c46ab32416df56e7c19b4475afd5abe186.tar.lz
mason-1e3c60c46ab32416df56e7c19b4475afd5abe186.tar.xz
mason-1e3c60c46ab32416df56e7c19b4475afd5abe186.tar.zst
mason-1e3c60c46ab32416df56e7c19b4475afd5abe186.zip
feat: add luaformatter (#116)
Co-authored-by: Ali Shahid <canttell@gmail>
Diffstat (limited to 'tests')
-rw-r--r--tests/mason-core/managers/luarocks_spec.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/mason-core/managers/luarocks_spec.lua b/tests/mason-core/managers/luarocks_spec.lua
index 749a7319..26ddcb4b 100644
--- a/tests/mason-core/managers/luarocks_spec.lua
+++ b/tests/mason-core/managers/luarocks_spec.lua
@@ -15,6 +15,7 @@ describe("luarocks manager", function()
"--tree",
path.package_prefix "dummy",
vim.NIL, -- --dev flag
+ vim.NIL, -- --server flag
"lua-cjson",
vim.NIL, -- version
}
@@ -33,6 +34,7 @@ describe("luarocks manager", function()
"--tree",
path.package_prefix "dummy",
vim.NIL, -- --dev flag
+ vim.NIL, -- --server flag
"lua-cjson",
"1.2.3",
}
@@ -51,12 +53,32 @@ describe("luarocks manager", function()
"--tree",
path.package_prefix "dummy",
"--dev",
+ vim.NIL, -- --server flag
"lua-cjson",
vim.NIL, -- version
}
end)
)
+ it(
+ "should provide --server flag",
+ async_test(function()
+ local handle = InstallHandleGenerator "dummy"
+ local ctx = InstallContextGenerator(handle)
+ installer.run_installer(ctx, luarocks.package("luaformatter", { server = "https://luarocks.org/dev" }))
+ assert.spy(ctx.spawn.luarocks).was_called(1)
+ assert.spy(ctx.spawn.luarocks).was_called_with {
+ "install",
+ "--tree",
+ path.package_prefix "dummy",
+ vim.NIL, -- --dev flag
+ "--server=https://luarocks.org/dev",
+ "luaformatter",
+ vim.NIL, -- version
+ }
+ end)
+ )
+
it("should parse outdated luarocks", function()
assert.same(
{