Fixed several issues

Changes:
1. Fixed typo in tests_base
2. Fixed `--no-index` issue
3. Refactored `add` test to be more strict

Closes #50
Refernces #46
pull/56/head
sobolevn 8 years ago
parent 904ce02cfc
commit f099802324
No known key found for this signature in database
GPG Key ID: FF672D568AE3C73E

@ -128,7 +128,7 @@ function _show_manual_for {
# VCS :
function _check_ignore {
git check-ignore -q "$1";
git check-ignore --no-index -q "$1";
echo $?
}

@ -53,7 +53,7 @@ function install_fixture_key {
$SECRETS_GPG_COMMAND --homedir="$FIXTURES_DIR/gpg/${1}" \
--no-permission-warning --output "$public_key" \
--armor --batch --yes --export "$email" > /dev/null 2>&1
--armor --batch --yes --export "$email"
$GPGTEST --import "$public_key" > /dev/null 2>&1
rm -f "$public_key"
}
@ -65,7 +65,7 @@ function install_fixture_full_key {
$SECRETS_GPG_COMMAND --homedir="$FIXTURES_DIR/gpg/${1}" \
--no-permission-warning --output "$private_key" --armor \
--yes --export-secret-key "$email" > /dev/null 2>&1
--yes --export-secret-key "$email"
$GPGTEST --allow-secret-key-import --import "$private_key" > /dev/null 2>&1
@ -93,7 +93,7 @@ function uninstall_fixture_full_key {
local fingerprint="$2"
if [[ -z "$fingerprint" ]]; then
# see issue_12, fingerprint on `gpg2` has different format:
fingerprint=$(_get_gpg_fingerprint_by_email "$email")
fingerprint=$(get_gpg_fingerprint_by_email "$email")
fi
$GPGTEST --batch --yes --delete-secret-keys "$fingerprint" > /dev/null 2>&1

@ -23,9 +23,9 @@ function teardown {
echo "content" > "$TEST_FILE"
run git secret add "$TEST_FILE"
rm -f "$TEST_FILE"
[ "$status" -eq 1 ]
rm -f "$TEST_FILE"
}
@ -50,10 +50,10 @@ function teardown {
echo "$filename" > ".gitignore"
run git secret add "$filename"
rm -f "$filename" ".gitignore"
[ "$status" -eq 0 ]
rm -f "$filename" ".gitignore"
local files_list=$(cat "$SECRETS_DIR_PATHS_MAPPING")
[ "$files_list" = "$filename" ]
}
@ -69,9 +69,10 @@ function teardown {
echo "$TEST_DIR/$TEST_FILE" > ".gitignore"
run git secret add "$TEST_DIR/$TEST_FILE"
rm -rf "$TEST_DIR"
[ "$status" -eq 0 ]
[[ "$output" == *"1 items added."* ]]
rm -rf "$TEST_DIR"
}
@ -82,11 +83,11 @@ function teardown {
run git secret add "$filename"
run git secret add "$filename"
rm -f "$filename" ".gitignore"
[ "$status" -eq 0 ]
[ "$output" = "1 items added." ]
rm -f "$filename" ".gitignore"
local files_list=`cat "$SECRETS_DIR_PATHS_MAPPING"`
[ "$files_list" = "$filename" ]
}
@ -102,8 +103,8 @@ function teardown {
echo "$filename2" >> ".gitignore"
run git secret add "$filename1" "$filename2"
rm -f "$filename1" "$filename2" ".gitignore"
[ "$status" -eq 0 ]
[ "$output" = "2 items added." ]
rm -f "$filename1" "$filename2" ".gitignore"
}

Loading…
Cancel
Save