mirror of
https://github.com/sobolevn/git-secret
synced 2024-11-08 19:10:31 +00:00
74f8a07166
* test that hiding secret with expired key fails * add test of user key without username. * revert to performing most tests with 'user1'. * move user4 private/public key fixtures * factor code fetching emails from keyrings, add comments. * use factored _warn_or_abort() * add to, clean up, and clarify comments.
34 lines
749 B
Bash
34 lines
749 B
Bash
#!/usr/bin/env bats
|
|
|
|
load _test_base
|
|
|
|
function setup {
|
|
install_fixture_key "$TEST_EXPIRED_USER"
|
|
|
|
set_state_initial
|
|
set_state_git
|
|
set_state_secret_init
|
|
set_state_secret_tell "$TEST_EXPIRED_USER"
|
|
}
|
|
|
|
function teardown {
|
|
uninstall_fixture_key "$TEST_EXPIRED_USER"
|
|
unset_current_state
|
|
}
|
|
|
|
@test "test 'hide' using expired key" {
|
|
FILE_TO_HIDE="$TEST_DEFAULT_FILENAME"
|
|
FILE_CONTENTS="hidden content юникод"
|
|
set_state_secret_add "$FILE_TO_HIDE" "$FILE_CONTENTS"
|
|
|
|
run git secret hide
|
|
|
|
#echo "# output of hide: $output" >&3
|
|
# output should look like 'abort: problem encrypting file with gpg: exit code 2: space file'
|
|
#echo "# status of hide: $status" >&3
|
|
|
|
[ $status -ne 0 ] # we expect failure here. Actual code is 2
|
|
}
|
|
|
|
|