add test by Emily-RoseSteyn, for #636 (#757)

This commit is contained in:
Josh Rabinowitz 2022-01-17 09:54:18 -05:00 committed by GitHub
parent b6711e2ac5
commit bf45916088
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -111,3 +111,23 @@ function _has_line {
run git secret remove -Z "$SECOND_FILE"
[ "$status" -ne 0 ]
}
@test "run 'removeperson' with email added twice" {
local email="$TEST_DEFAULT_USER"
# This should fail because you can't add the same email twice
run git secret tell "$email"
[ "$status" -ne 0 ]
# Then test that the normal remove test runs
run git secret removeperson "$email"
[ "$status" -eq 0 ]
# Testing output:
[[ "$output" == *"$email"* ]]
# Then whoknows must return an error with status code 1, because no one is in list
run git secret whoknows
[ "$status" -eq 1 ]
}