Add support for multiple git-check-assertions blocks
This commit is contained in:
parent
80ff74cdf9
commit
7e483b8a7f
4 changed files with 31 additions and 6 deletions
|
|
@ -124,6 +124,27 @@ commit_with_assertion() {
|
|||
assert_output "feature"
|
||||
}
|
||||
|
||||
@test "multiple git-check-assertions blocks in one commit message run in order" {
|
||||
git checkout -b feature
|
||||
git commit --allow-empty -F - <<-EOF
|
||||
test
|
||||
|
||||
\`\`\`git-check-assertions
|
||||
touch ../test1
|
||||
\`\`\`
|
||||
|
||||
\`\`\`git-check-assertions
|
||||
touch ../test2
|
||||
\`\`\`
|
||||
EOF
|
||||
|
||||
run git-check-assertions
|
||||
|
||||
assert_success
|
||||
assert_file_exists ../test1
|
||||
assert_file_exists ../test2
|
||||
}
|
||||
|
||||
@test "should stop at the first failing assertion block and return to the original branch" {
|
||||
git checkout -b feature
|
||||
commit_with_assertion "touch ../test1 && exit 3"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue