Support ✓/✗ as alternatives to [success]/[failure]
This commit is contained in:
parent
4704cc088d
commit
0719fa33c2
3 changed files with 49 additions and 21 deletions
|
|
@ -368,6 +368,34 @@ commit_with_assertion() {
|
|||
assert_output --partial "Expected command to fail, but it succeeded."
|
||||
}
|
||||
|
||||
@test "a ✓ command should succeed if the executed command succeeded" {
|
||||
git checkout -b feature
|
||||
commit_with_assertion '✓ exit 0'
|
||||
|
||||
run git-check-assertions
|
||||
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "a ✗ command should succeed if the executed command failed" {
|
||||
git checkout -b feature
|
||||
commit_with_assertion '✗ exit 1'
|
||||
|
||||
run git-check-assertions
|
||||
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "you can mix symbols and bracketed asserts in the same block" {
|
||||
git checkout -b feature
|
||||
commit_with_assertion $'✓ echo hello\nhello\n[failure] exit 0'
|
||||
|
||||
run git-check-assertions
|
||||
|
||||
assert_failure
|
||||
assert_output --partial "Expected command to fail, but it succeeded."
|
||||
}
|
||||
|
||||
@test "an output line should succeed if the output contains the given string" {
|
||||
git checkout -b feature
|
||||
commit_with_assertion $'[success] echo hello\nhello'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue