Add test for multi-line commit messages

This commit is contained in:
Stefan Zweifel 2023-01-07 12:06:10 +01:00
parent 86fb2e11b2
commit fe00d25867

View File

@ -1092,3 +1092,23 @@ cat_github_output() {
assert_failure; assert_failure;
assert_line "::error::git-auto-commit could not find git binary. Please make sure git is available." assert_line "::error::git-auto-commit could not find git binary. Please make sure git is available."
} }
@test "It creates multi-line commit messages" {
touch "${FAKE_LOCAL_REPOSITORY}"/new-file-{1,2,3}.txt
COMMIT_MESSAGE=$(cat <<-END
this commit message
has multiple lines
END
)
INPUT_COMMIT_MESSAGE=$COMMIT_MESSAGE
run git_auto_commit
assert_success
# Assert last commit was signed off
run git log -n 1
assert_output --partial $COMMIT_MESSAGE
}