diff options
| author | William Boman <william@redwill.se> | 2022-05-17 23:23:47 +0200 |
|---|---|---|
| committer | William Boman <william@redwill.se> | 2022-05-17 23:23:47 +0200 |
| commit | 97b36e9938cc06156212accc73411afd7bab3a01 (patch) | |
| tree | 2b7dfc815bd7bcbfc28d93ac2f6b56bc7fb90dd5 /tests/core/spawn_spec.lua | |
| parent | fix(spawn): avoid spawning commands that aren't on PATH (#706) (diff) | |
| download | mason-97b36e9938cc06156212accc73411afd7bab3a01.tar mason-97b36e9938cc06156212accc73411afd7bab3a01.tar.gz mason-97b36e9938cc06156212accc73411afd7bab3a01.tar.bz2 mason-97b36e9938cc06156212accc73411afd7bab3a01.tar.lz mason-97b36e9938cc06156212accc73411afd7bab3a01.tar.xz mason-97b36e9938cc06156212accc73411afd7bab3a01.tar.zst mason-97b36e9938cc06156212accc73411afd7bab3a01.zip | |
tests(spawn): fix bad test name and add missing case
Diffstat (limited to 'tests/core/spawn_spec.lua')
| -rw-r--r-- | tests/core/spawn_spec.lua | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/core/spawn_spec.lua b/tests/core/spawn_spec.lua index c7b4f320..73bcdf28 100644 --- a/tests/core/spawn_spec.lua +++ b/tests/core/spawn_spec.lua @@ -163,7 +163,7 @@ describe("async spawn", function() ) it( - "should skip checking executable", + "should check whether command is executable", async_test(function() local result = spawn.my_cmd {} assert.is_true(result:is_failure()) @@ -173,4 +173,17 @@ describe("async spawn", function() ) end) ) + + it( + "should skip checking whether command is executable", + async_test(function() + stub(process, "spawn", function(_, _, callback) + callback(false, 127) + end) + + local result = spawn.my_cmd { check_executable = false } + assert.is_true(result:is_failure()) + assert.spy(process.spawn).was_called(1) + end) + ) end) |
