diff options
| author | William Boman <william@redwill.se> | 2022-05-27 19:43:12 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-27 19:43:12 +0200 |
| commit | 338063ab0d678103f09a0ce86ce9b292a12ca17f (patch) | |
| tree | 068d3c5768b039dffd8865a276c27a8694844c0c /tests/core | |
| parent | test(luarocks): add more test cases (diff) | |
| download | mason-338063ab0d678103f09a0ce86ce9b292a12ca17f.tar mason-338063ab0d678103f09a0ce86ce9b292a12ca17f.tar.gz mason-338063ab0d678103f09a0ce86ce9b292a12ca17f.tar.bz2 mason-338063ab0d678103f09a0ce86ce9b292a12ca17f.tar.lz mason-338063ab0d678103f09a0ce86ce9b292a12ca17f.tar.xz mason-338063ab0d678103f09a0ce86ce9b292a12ca17f.tar.zst mason-338063ab0d678103f09a0ce86ce9b292a12ca17f.zip | |
test(luarock): stub std.ensure_executable (#725)
Diffstat (limited to 'tests/core')
| -rw-r--r-- | tests/core/managers/luarocks_spec.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/core/managers/luarocks_spec.lua b/tests/core/managers/luarocks_spec.lua index 359f3b4c..20de3719 100644 --- a/tests/core/managers/luarocks_spec.lua +++ b/tests/core/managers/luarocks_spec.lua @@ -1,6 +1,8 @@ local mock = require "luassert.mock" +local stub = require "luassert.stub" local installer = require "nvim-lsp-installer.core.installer" local luarocks = require "nvim-lsp-installer.core.managers.luarocks" +local std = require "nvim-lsp-installer.core.managers.std" local Optional = require "nvim-lsp-installer.core.optional" describe("luarocks manager", function() @@ -17,9 +19,10 @@ describe("luarocks manager", function() it( "install provided package", async_test(function() + stub(std, "ensure_executable") + std.ensure_executable.returns() installer.run_installer(ctx, luarocks.package "lua-cjson") assert.spy(ctx.spawn.luarocks).was_called(1) - print(vim.inspect(ctx.spawn.luarocks)) assert.spy(ctx.spawn.luarocks).was_called_with { "install", "--dev", @@ -34,10 +37,11 @@ describe("luarocks manager", function() it( "install provided version", async_test(function() + stub(std, "ensure_executable") + std.ensure_executable.returns() ctx.requested_version = Optional.of "1.2.3" installer.run_installer(ctx, luarocks.package "lua-cjson") assert.spy(ctx.spawn.luarocks).was_called(1) - print(vim.inspect(ctx.spawn.luarocks)) assert.spy(ctx.spawn.luarocks).was_called_with { "install", "--dev", |
