From ef796bc2c1b8682c1c61b0fbcbe359c8985b7ee5 Mon Sep 17 00:00:00 2001 From: Tim Byrne Date: Sun, 8 Jan 2017 11:04:58 -0600 Subject: [PATCH] Add acceptance test for space-lines/empty-lines in .yadm/encrypt (#40) --- test/109_accept_encryption.bats | 37 +++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/test/109_accept_encryption.bats b/test/109_accept_encryption.bats index 0dfd735..c922afc 100644 --- a/test/109_accept_encryption.bats +++ b/test/109_accept_encryption.bats @@ -233,6 +233,43 @@ EOF validate_archive symmetric } +@test "Command 'encrypt' (empty lines and space lines in YADM_ARCHIVE)" { + echo " + When 'encrypt' command is provided, + and YADM_ENCRYPT is present + Create YADM_ARCHIVE + Report the archive created + Archive should be valid + Exit with 0 + " + + #; add empty lines to YADM_ARCHIVE + local original_encrypt + original_encrypt=$(cat "$T_YADM_ENCRYPT") + echo -e " \n\n \n" >> "$T_YADM_ENCRYPT" + + #; run encrypt + run expect < "$T_YADM_ENCRYPT" + + #; validate the archive + validate_archive symmetric +} + @test "Command 'encrypt' (overwrite)" { echo " When 'encrypt' command is provided,