mirror of
https://github.com/sobolevn/git-secret
synced 2024-11-18 15:26:58 +00:00
50 lines
880 B
Bash
50 lines
880 B
Bash
#!/usr/bin/env bats
|
|
|
|
load _test_base
|
|
|
|
FILE_TO_HIDE="file_to_hide"
|
|
FILE_CONTENTS="hidden content юникод"
|
|
|
|
|
|
function setup {
|
|
install_fixture_key "$TEST_DEFAULT_USER"
|
|
|
|
set_state_git
|
|
set_state_secret_init
|
|
set_state_secret_tell "$TEST_DEFAULT_USER"
|
|
set_state_secret_add "$FILE_TO_HIDE" "$FILE_CONTENTS"
|
|
}
|
|
|
|
|
|
function teardown {
|
|
uninstall_fixture_key $TEST_DEFAULT_USER
|
|
unset_current_state
|
|
|
|
rm -f "$FILE_TO_HIDE"
|
|
}
|
|
|
|
|
|
@test "run 'hide' normally" {
|
|
run git secret hide
|
|
[ "$status" -eq 0 ]
|
|
[ "$output" = "done. all 1 files are hidden." ]
|
|
}
|
|
|
|
|
|
@test "run 'hide' with params" {
|
|
run git secret hide -v -c
|
|
[ "$status" -eq 0 ]
|
|
}
|
|
|
|
|
|
@test "run 'hide' for multiple users" {
|
|
local new_user="user2"
|
|
|
|
install_fixture_key "$new_user"
|
|
set_state_secret_tell "$new_user"
|
|
|
|
run git secret hide
|
|
[ "$status" -eq 0 ]
|
|
[ "$output" = "done. all 1 files are hidden." ]
|
|
}
|