Skip to content

Add test for --vault-password-file script #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: v0.5.0-wip
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions test/fixture/repo.git/.vault-pass-script
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

echo "pa55word"
8 changes: 8 additions & 0 deletions test/git-diff-ansible-vault.bats
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@ EOF
assert_line "+ - bash"
}

@test "--vault-password-file with specified script unlocks vault" {
run git diff-ansible-vault --vault-password-file .vault-pass-script --verbose
assert_success
assert_line "[INFO] VAULT_PASSWORD_FILE: .vault-pass-script"
assert_line "diff --git a/vault.yml b/vault.yml"
assert_line "+ - bash"
}

@test "--vault-password-file with non-existant path exits with error" {
run git diff-ansible-vault --vault-password-file .not-a-file
assert_failure "[ERROR] --vault-password-file not found: .not-a-file"
Expand Down