mirror of https://github.com/sobolevn/git-secret
small grammar change, update,
fixes for linter errors about 'which' For example: in utils/deb/deb-ci.sh line 27: 'which git-secret': SC2230: which is non-standard. Use builtin 'command -v' instead. remove inoperative links reflect code review input add test for 'git secret cat' restore sponsor linkspull/142/head
parent
70e0fcda13
commit
c760513e35
@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load _test_base
|
||||
|
||||
FILE_TO_HIDE="file_to_hide"
|
||||
FILE_CONTENTS="hidden content юникод"
|
||||
|
||||
FINGERPRINT=""
|
||||
|
||||
|
||||
function setup {
|
||||
FINGERPRINT=$(install_fixture_full_key "$TEST_DEFAULT_USER")
|
||||
|
||||
set_state_initial
|
||||
set_state_git
|
||||
set_state_secret_init
|
||||
set_state_secret_tell "$TEST_DEFAULT_USER"
|
||||
set_state_secret_add "$FILE_TO_HIDE" "$FILE_CONTENTS"
|
||||
set_state_secret_hide
|
||||
}
|
||||
|
||||
|
||||
function teardown {
|
||||
#rm "$FILE_TO_HIDE"
|
||||
|
||||
uninstall_fixture_full_key "$TEST_DEFAULT_USER" "$FINGERPRINT"
|
||||
unset_current_state
|
||||
}
|
||||
|
||||
|
||||
@test "run 'cat' with password argument" {
|
||||
cp "$FILE_TO_HIDE" "${FILE_TO_HIDE}2"
|
||||
rm -f "$FILE_TO_HIDE"
|
||||
|
||||
local password=$(test_user_password "$TEST_DEFAULT_USER")
|
||||
run git secret cat -d "$TEST_GPG_HOMEDIR" -p "$password" "$FILE_TO_HIDE"
|
||||
|
||||
[ "$status" -eq 0 ]
|
||||
|
||||
# $output is the output from 'git secret cat' above
|
||||
[ "$FILE_CONTENTS" == "$output" ]
|
||||
|
||||
rm "${FILE_TO_HIDE}2"
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue