Introduce assert_success
This commit is contained in:
parent
a1ffb1abd4
commit
1a10b24b06
2 changed files with 36 additions and 0 deletions
|
|
@ -112,3 +112,22 @@ commit_with_assertion() {
|
|||
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "assert_success should succeed if the executed command succeeded" {
|
||||
git checkout -b feature
|
||||
commit_with_assertion $'run exit 0\nassert_success'
|
||||
|
||||
run git-check-assertions
|
||||
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "assert_success should fail if the executed command failed" {
|
||||
git checkout -b feature
|
||||
commit_with_assertion $'run exit 1\nassert_success'
|
||||
|
||||
run git-check-assertions
|
||||
|
||||
assert_failure
|
||||
assert_output --partial "Expected command to succeed, but it failed."
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue