aboutsummaryrefslogtreecommitdiffstats
path: root/tests/core/managers
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-04-21 12:09:59 +0200
committerGitHub <noreply@github.com>2022-04-21 12:09:59 +0200
commitb68fcc6bb2c770495ff8e2508c06dfdd49abcc80 (patch)
treedf7c71efb59958deb21a18eeccf3e3c43c4cd704 /tests/core/managers
parentrun autogen_metadata.lua (diff)
downloadmason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.tar
mason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.tar.gz
mason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.tar.bz2
mason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.tar.lz
mason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.tar.xz
mason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.tar.zst
mason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.zip
chore: refactor remaining installers to async impl (#616)
Diffstat (limited to 'tests/core/managers')
-rw-r--r--tests/core/managers/gem_spec.lua18
-rw-r--r--tests/core/managers/git_spec.lua2
-rw-r--r--tests/core/managers/go_spec.lua19
3 files changed, 21 insertions, 18 deletions
diff --git a/tests/core/managers/gem_spec.lua b/tests/core/managers/gem_spec.lua
index beab3968..90d0c390 100644
--- a/tests/core/managers/gem_spec.lua
+++ b/tests/core/managers/gem_spec.lua
@@ -97,10 +97,11 @@ strscan (default: 3.0.1)
assert.spy(spawn.gem).was_called_with(match.tbl_containing {
"list",
cwd = "/tmp/install/dir",
- env = match.all_of(
- match.list_containing "GEM_HOME=/tmp/install/dir",
- match.list_containing "GEM_PATH=/tmp/install/dir"
- ),
+ env = match.tbl_containing {
+ GEM_HOME = "/tmp/install/dir",
+ GEM_PATH = "/tmp/install/dir",
+ PATH = match.matches "^/tmp/install/dir/bin:.*$",
+ },
})
assert.is_true(result:is_success())
assert.equals("0.44.0", result:get_or_nil())
@@ -139,10 +140,11 @@ solargraph (0.44.0 < 0.44.3)
assert.spy(spawn.gem).was_called_with(match.tbl_containing {
"outdated",
cwd = "/tmp/install/dir",
- env = match.all_of(
- match.list_containing "GEM_HOME=/tmp/install/dir",
- match.list_containing "GEM_PATH=/tmp/install/dir"
- ),
+ env = match.tbl_containing {
+ GEM_HOME = "/tmp/install/dir",
+ GEM_PATH = "/tmp/install/dir",
+ PATH = match.matches "^/tmp/install/dir/bin:.*$",
+ },
})
assert.is_true(result:is_success())
assert.equals(
diff --git a/tests/core/managers/git_spec.lua b/tests/core/managers/git_spec.lua
index b73760ee..25e58f6e 100644
--- a/tests/core/managers/git_spec.lua
+++ b/tests/core/managers/git_spec.lua
@@ -42,6 +42,7 @@ describe("git manager", function()
"clone",
"--depth",
"1",
+ vim.NIL,
"https://github.com/williamboman/nvim-lsp-installer.git",
".",
}
@@ -60,6 +61,7 @@ describe("git manager", function()
"clone",
"--depth",
"1",
+ vim.NIL,
"https://github.com/williamboman/nvim-lsp-installer.git",
".",
}
diff --git a/tests/core/managers/go_spec.lua b/tests/core/managers/go_spec.lua
index f299bf43..c7218335 100644
--- a/tests/core/managers/go_spec.lua
+++ b/tests/core/managers/go_spec.lua
@@ -1,4 +1,3 @@
-local match = require "luassert.match"
local mock = require "luassert.mock"
local stub = require "luassert.stub"
local spy = require "luassert.spy"
@@ -25,24 +24,24 @@ describe("go manager", function()
ctx.requested_version = Optional.of "42.13.37"
installer.run_installer(ctx, go.packages { "main-package", "supporting-package", "supporting-package2" })
assert.spy(ctx.spawn.go).was_called(3)
- assert.spy(ctx.spawn.go).was_called_with(match.tbl_containing {
+ assert.spy(ctx.spawn.go).was_called_with {
"install",
"-v",
"main-package@42.13.37",
- env = match.list_containing "GOBIN=/tmp/install-dir",
- })
- assert.spy(ctx.spawn.go).was_called_with(match.tbl_containing {
+ env = { GOBIN = "/tmp/install-dir" },
+ }
+ assert.spy(ctx.spawn.go).was_called_with {
"install",
"-v",
"supporting-package@latest",
- env = match.list_containing "GOBIN=/tmp/install-dir",
- })
- assert.spy(ctx.spawn.go).was_called_with(match.tbl_containing {
+ env = { GOBIN = "/tmp/install-dir" },
+ }
+ assert.spy(ctx.spawn.go).was_called_with {
"install",
"-v",
"supporting-package2@latest",
- env = match.list_containing "GOBIN=/tmp/install-dir",
- })
+ env = { GOBIN = "/tmp/install-dir" },
+ }
end)
)