prevent escape '#' when generating env_file string

This commit is contained in:
Alan Oliveira
2024-10-15 14:24:09 +09:00
parent 607368121e
commit 844e3acf50
2 changed files with 13 additions and 1 deletions

View File

@@ -11,6 +11,16 @@ class EnvFileTest < ActiveSupport::TestCase
Kamal::EnvFile.new(env).to_s
end
test "to_s won't escape '#'" do
env = {
"foo" => "\#$foo",
"bar" => "\#{bar}"
}
assert_equal "foo=\#$foo\nbar=\#{bar}\n", \
Kamal::EnvFile.new(env).to_s
end
test "to_str won't escape chinese characters" do
env = {
"foo" => '你好 means hello, "欢迎" means welcome, that\'s simple! 😃 {smile}'