Skip to content

Commit 087a475

Browse files
Make clear test work on any system
1 parent 3f682cf commit 087a475

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

spec/ergoterm/commands_spec.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
local commands = require("ergoterm.commands")
44
local terms = require("ergoterm")
55
local test_helpers = require("test_helpers")
6+
local utils = require("ergoterm.utils")
67

78
after_each(function()
89
terms.cleanup_all({ force = true })
@@ -265,7 +266,11 @@ describe("M.send", function()
265266
})
266267
end)
267268

268-
it("clear screehn if specified", function()
269+
it("clear screen if specified", function()
270+
local original_is_windows = utils.is_windows
271+
---@diagnostic disable-next-line: duplicate-set-field
272+
utils.is_windows = function() return false end
273+
269274
local term = terms.Terminal:new():start()
270275
local spy_chansend = spy.on(vim.fn, "chansend")
271276

@@ -275,6 +280,8 @@ describe("M.send", function()
275280
term:get_state("job_id"),
276281
{ "clear", "" }
277282
)
283+
284+
utils.is_windows = original_is_windows
278285
end)
279286

280287
it("uses last focused terminal when called with the bang option", function()

0 commit comments

Comments
 (0)