Skip to content

Commit d51d214

Browse files
committed
Add tests for shell wrapping of exec command
1 parent 728f92d commit d51d214

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

test/spoom/context/exec_test.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ class ExecTest < Minitest::Test
99
def test_context_exec
1010
context = Context.mktmp!
1111

12-
assert_raises(Errno::ENOENT) do
13-
context.exec("command/not/found")
14-
end
12+
# Test that unknown commands return a failed status (not raise an exception)
13+
# due to shell wrapping in exec method
14+
res = context.exec("command_that_does_not_exist")
15+
refute(res.status)
16+
refute_empty(res.err)
1517

1618
res = context.exec("echo 'Hello, world!'")
1719
assert_equal("Hello, world!\n", res.out)

0 commit comments

Comments
 (0)