aboutsummaryrefslogtreecommitdiffstats
path: root/tests/core/spawn_spec.lua
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/spawn_spec.lua
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/spawn_spec.lua')
-rw-r--r--tests/core/spawn_spec.lua15
1 files changed, 7 insertions, 8 deletions
diff --git a/tests/core/spawn_spec.lua b/tests/core/spawn_spec.lua
index eec14c30..d4716b61 100644
--- a/tests/core/spawn_spec.lua
+++ b/tests/core/spawn_spec.lua
@@ -9,7 +9,7 @@ describe("async spawn", function()
"should spawn commands and return stdout & stderr",
async_test(function()
local result = spawn.env {
- env = { "FOO=bar" },
+ env_raw = { "FOO=bar" },
}
assert.is_true(result:is_success())
assert.equals("FOO=bar\n", result:get_or_nil().stdout)
@@ -22,7 +22,7 @@ describe("async spawn", function()
async_test(function()
local stdio = process.in_memory_sink()
local result = spawn.env {
- env = { "FOO=bar" },
+ env_raw = { "FOO=bar" },
stdio_sink = stdio.sink,
}
assert.is_true(result:is_success())
@@ -39,7 +39,7 @@ describe("async spawn", function()
local result = spawn.bash {
"-c",
'echo "Hello $VAR"',
- env = { "VAR=world" },
+ env = { VAR = "world" },
}
assert.is_true(result:is_success())
@@ -54,12 +54,11 @@ describe("async spawn", function()
spy.on(process, "spawn")
local result = spawn.bash {
vim.NIL,
- spawn._when(true, "-c"),
- spawn._when(false, "shouldnotbeincluded"),
vim.NIL,
+ "-c",
{ vim.NIL, vim.NIL },
'echo "Hello $VAR"',
- env = { "VAR=world" },
+ env = { VAR = "world" },
}
assert.is_true(result:is_success())
@@ -73,7 +72,7 @@ describe("async spawn", function()
stdout = match.is_function(),
stderr = match.is_function(),
},
- env = match.tbl_containing { "VAR=world" },
+ env = match.list_containing "VAR=world",
args = match.tbl_containing {
"-c",
'echo "Hello $VAR"',
@@ -89,7 +88,7 @@ describe("async spawn", function()
async_test(function()
local result = spawn.bash {
{ "-c", 'echo "Hello $VAR"' },
- env = { "VAR=world" },
+ env = { VAR = "world" },
}
assert.is_true(result:is_success())