We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 58d95c3 commit bfa099cCopy full SHA for bfa099c
test/file.bats
@@ -238,3 +238,22 @@ load "test-helper"
238
239
rm -f "$tmp_file"
240
}
241
+
242
+@test "file_fill_template non empty file, replace multiple" {
243
+ local -r tmp_file=$(mktemp)
244
+ local -a auto_fill=("<__PLACEHOLDER__>=hello")
245
+ auto_fill+=("<__PLACEHOLDER2__>=foo")
246
247
+ local -r file_contents=$(echo -e "abc\n<__PLACEHOLDER__> world\n<__PLACEHOLDER2__> baz")
248
249
+ echo "$file_contents" > "$tmp_file"
250
251
+ run file_fill_template "$tmp_file" "${auto_fill[@]}"
252
+ assert_success
253
254
+ local -r actual=$(cat "$tmp_file")
255
+ local -r expected=$(echo -e "abc\nhello world\nfoo baz")
256
+ assert_equal "$expected" "$actual"
257
258
+ rm -f "$tmp_file"
259
+}
0 commit comments