Escape the audit line

Makes it compatible with zsh.
This commit is contained in:
Donal McBreen
2025-04-22 08:26:51 +01:00
parent f898fb8cb7
commit 63f65d60c6
2 changed files with 15 additions and 13 deletions

View File

@@ -20,8 +20,7 @@ class CommandsAuditorTest < ActiveSupport::TestCase
assert_equal [
:mkdir, "-p", ".kamal", "&&",
:echo,
"[#{@recorded_at}] [#{@performer}]",
"app removed container",
"\"[#{@recorded_at}] [#{@performer}] app removed container\"",
">>", ".kamal/app-audit.log"
], @auditor.record("app removed container")
end
@@ -31,8 +30,7 @@ class CommandsAuditorTest < ActiveSupport::TestCase
assert_equal [
:mkdir, "-p", ".kamal", "&&",
:echo,
"[#{@recorded_at}] [#{@performer}] [staging]",
"app removed container",
"\"[#{@recorded_at}] [#{@performer}] [staging] app removed container\"",
">>", ".kamal/app-staging-audit.log"
], auditor.record("app removed container")
end
@@ -43,8 +41,7 @@ class CommandsAuditorTest < ActiveSupport::TestCase
assert_equal [
:mkdir, "-p", ".kamal", "&&",
:echo,
"[#{@recorded_at}] [#{@performer}] [web]",
"app removed container",
"\"[#{@recorded_at}] [#{@performer}] [web] app removed container\"",
">>", ".kamal/app-audit.log"
], auditor.record("app removed container")
end
@@ -54,8 +51,7 @@ class CommandsAuditorTest < ActiveSupport::TestCase
assert_equal [
:mkdir, "-p", ".kamal", "&&",
:echo,
"[#{@recorded_at}] [#{@performer}] [value]",
"app removed container",
"\"[#{@recorded_at}] [#{@performer}] [value] app removed container\"",
">>", ".kamal/app-audit.log"
], @auditor.record("app removed container", detail: "value")
end