fix quoting for files with spaces. use filenames from _test_base.bats

pull/239/head
joshr 6 years ago
parent 5c639cf8e7
commit 7096499465

@ -2,8 +2,8 @@
load _test_base load _test_base
FIRST_FILE="file_to_hide1" FIRST_FILE="$TEST_DEFAULT_FILENAME"
SECOND_FILE="file_to_hide2" SECOND_FILE="$TEST_SECOND_FILENAME"
function setup { function setup {
@ -55,8 +55,8 @@ function _has_line {
[ "$other_files" -eq 0 ] [ "$other_files" -eq 0 ]
# Both files should be present: # Both files should be present:
local first_encrypted_file=$(_get_encrypted_filename $FIRST_FILE) local first_encrypted_file=$(_get_encrypted_filename "$FIRST_FILE")
local second_encrypted_file=$(_get_encrypted_filename $SECOND_FILE) local second_encrypted_file=$(_get_encrypted_filename "$SECOND_FILE")
[ -f "$first_encrypted_file" ] [ -f "$first_encrypted_file" ]
[ -f "$second_encrypted_file" ] [ -f "$second_encrypted_file" ]
@ -74,8 +74,8 @@ function _has_line {
[ "$second_line" -eq 1 ] [ "$second_line" -eq 1 ]
# Both files should be present: # Both files should be present:
local first_encrypted_file=$(_get_encrypted_filename $FIRST_FILE) local first_encrypted_file=$(_get_encrypted_filename "$FIRST_FILE")
local second_encrypted_file=$(_get_encrypted_filename $SECOND_FILE) local second_encrypted_file=$(_get_encrypted_filename "$SECOND_FILE")
[ -f "$first_encrypted_file" ] [ -f "$first_encrypted_file" ]
[ -f "$second_encrypted_file" ] [ -f "$second_encrypted_file" ]
@ -88,7 +88,7 @@ function _has_line {
# Prepartions: # Prepartions:
local folder="somedir" local folder="somedir"
local file_in_folder="$folder/file_to_hide3" local file_in_folder="$folder/$TEST_THIRD_FILENAME"
mkdir -p "$folder" mkdir -p "$folder"
set_state_secret_add "$file_in_folder" "somecontent3" set_state_secret_add "$file_in_folder" "somecontent3"
@ -101,7 +101,7 @@ function _has_line {
local mapping_contains=$(_has_line "$file_in_folder") local mapping_contains=$(_has_line "$file_in_folder")
[ "$mapping_contains" -eq 1 ] [ "$mapping_contains" -eq 1 ]
local encrypted_file=$(_get_encrypted_filename $file_in_folder) local encrypted_file=$(_get_encrypted_filename "$file_in_folder")
[ -f "$encrypted_file" ] [ -f "$encrypted_file" ]
# Cleaning up: # Cleaning up:
@ -118,8 +118,8 @@ function _has_line {
local mapping_contains=$(_has_line "$SECOND_FILE") local mapping_contains=$(_has_line "$SECOND_FILE")
[ "$mapping_contains" -eq 1 ] [ "$mapping_contains" -eq 1 ]
local first_encrypted_file=$(_get_encrypted_filename $FIRST_FILE) local first_encrypted_file=$(_get_encrypted_filename "$FIRST_FILE")
local second_encrypted_file=$(_get_encrypted_filename $SECOND_FILE) local second_encrypted_file=$(_get_encrypted_filename "$SECOND_FILE")
echo "$output" echo "$output"
echo "$first_encrypted_file and $second_encrypted_file" echo "$first_encrypted_file and $second_encrypted_file"

Loading…
Cancel
Save