diff options
| author | William Boman <william@redwill.se> | 2022-12-26 17:43:01 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-26 17:43:01 +0100 |
| commit | 21a2475da458e97be798bdc9261da24460da5c65 (patch) | |
| tree | 7138d6b8d3badd52b738d773449c9a388a1af540 /tests/mason-core | |
| parent | feat(powershell): set $ErrorActionPreference = "Stop"; (#807) (diff) | |
| download | mason-21a2475da458e97be798bdc9261da24460da5c65.tar mason-21a2475da458e97be798bdc9261da24460da5c65.tar.gz mason-21a2475da458e97be798bdc9261da24460da5c65.tar.bz2 mason-21a2475da458e97be798bdc9261da24460da5c65.tar.lz mason-21a2475da458e97be798bdc9261da24460da5c65.tar.xz mason-21a2475da458e97be798bdc9261da24460da5c65.tar.zst mason-21a2475da458e97be798bdc9261da24460da5c65.zip | |
refactor: interact with libuv pipes in async context (#808)
Also now properly close pipes (shutdown -> close).
Diffstat (limited to 'tests/mason-core')
| -rw-r--r-- | tests/mason-core/managers/powershell_spec.lua | 8 |
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() |
