Merge pull request #1405 from mike-weiner/fix-1399-fail-exec-without-cmd

Raise an error to the user if the exec command parsed is blank
This commit is contained in:
Donal McBreen
2025-04-21 16:16:06 +01:00
committed by GitHub
2 changed files with 11 additions and 0 deletions

View File

@@ -312,6 +312,13 @@ class CliAppTest < CliTestCase
end
end
test "exec without command fails" do
error = assert_raises(ArgumentError, "Exec requires a command to be specified") do
run_command("exec")
end
assert_equal "No command provided. You must specify a command to execute.", error.message
end
test "exec separate arguments" do
run_command("exec", "ruby", " -v").tap do |output|
assert_match "docker run --rm --network kamal --env-file .kamal/apps/app/env/roles/web.env --log-opt max-size=\"10m\" dhh/app:latest ruby -v", output