aboutsummaryrefslogtreecommitdiffstats
path: root/tests/mason-core/managers/powershell_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/mason-core/managers/powershell_spec.lua')
-rw-r--r--tests/mason-core/managers/powershell_spec.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/mason-core/managers/powershell_spec.lua b/tests/mason-core/managers/powershell_spec.lua
index 0d6851d1..0229388a 100644
--- a/tests/mason-core/managers/powershell_spec.lua
+++ b/tests/mason-core/managers/powershell_spec.lua
@@ -60,7 +60,7 @@ describe("powershell manager", function()
end)
it("should provide default powershell options via script stdin", function()
- local stdin = mock.new { shutdown = mockx.just_runs }
+ local stdin = mock.new {}
stub(spawn, "pwsh", function(args)
args.on_spawn(nil, { stdin })
end)
@@ -68,6 +68,9 @@ describe("powershell manager", function()
stub(vim.loop, "write", function(_, _, callback)
callback()
end)
+ stub(vim.loop, "shutdown", function(_, callback)
+ callback()
+ end)
vim.fn.executable.on_call_with("pwsh").returns(1)
powershell().script "echo 'Is this bash?'"
@@ -86,7 +89,8 @@ describe("powershell manager", function()
match.is_function()
)
assert.spy(vim.loop.write).was_called_with(match.is_ref(stdin), "echo 'Is this bash?'", match.is_function())
- assert.spy(stdin.shutdown).was_called(1)
+ assert.spy(vim.loop.shutdown).was_called(1)
+ assert.spy(vim.loop.shutdown).was_called_with(match.is_ref(stdin), match.is_function())
end)
it("should provide default powershell options via command interface", function()