diff options
Diffstat (limited to 'tests/mason-core/process_spec.lua')
| -rw-r--r-- | tests/mason-core/process_spec.lua | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/tests/mason-core/process_spec.lua b/tests/mason-core/process_spec.lua index 38ea94de..06330cdd 100644 --- a/tests/mason-core/process_spec.lua +++ b/tests/mason-core/process_spec.lua @@ -4,25 +4,22 @@ local spy = require "luassert.spy" describe("process.spawn", function() -- Unix only - it( - "should spawn command and feed output to sink", - async_test(function() - local stdio = process.in_memory_sink() - local callback = spy.new() - process.spawn("env", { - args = {}, - env = { - "HELLO=world", - "MY_ENV=var", - }, - stdio_sink = stdio.sink, - }, callback) + it("should spawn command and feed output to sink", function() + local stdio = process.in_memory_sink() + local callback = spy.new() + process.spawn("env", { + args = {}, + env = { + "HELLO=world", + "MY_ENV=var", + }, + stdio_sink = stdio.sink, + }, callback) - assert.wait_for(function() - assert.spy(callback).was_called(1) - assert.spy(callback).was_called_with(true, 0, match.is_number()) - assert.equals(table.concat(stdio.buffers.stdout, ""), "HELLO=world\nMY_ENV=var\n") - end) + assert.wait(function() + assert.spy(callback).was_called(1) + assert.spy(callback).was_called_with(true, 0, match.is_number()) + assert.equals(table.concat(stdio.buffers.stdout, ""), "HELLO=world\nMY_ENV=var\n") end) - ) + end) end) |
