From ec3d47b1096d43084629d2ce37c3163dbcf0a8b0 Mon Sep 17 00:00:00 2001 From: "Robert A. Vincent II (Bob-Vee)" Date: Thu, 29 Jul 2021 11:16:37 -0400 Subject: [PATCH] Issue #179 Add tests for empty eyaml values --- features/edit.feature | 5 ++++- features/sandbox/test_new_values.yaml | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/features/edit.feature b/features/edit.feature index 6e84c207..3b83a54a 100644 --- a/features/edit.feature +++ b/features/edit.feature @@ -66,6 +66,7 @@ Feature: eyaml editing When I run `eyaml edit non-existant-file.eyaml` When I run `eyaml decrypt -e non-existant-file.eyaml` Then the output should not match /#| This is eyaml edit mode/ + And the output should match /new_key0: DEC::PKCS7\[\]\!/ And the output should match /new_key1: DEC::PKCS7\[new value one\]\!/ And the output should match /new_key2: DEC::PKCS7\[new value two\]\!/ @@ -99,6 +100,7 @@ Feature: eyaml editing When I run `eyaml edit test_input.eyaml` When I run `eyaml decrypt -e test_input.eyaml` Then the output should match /encrypted_string: DEC::PKCS7\[planet of the apes\]\!/ + And the output should match /new_key0: DEC::PKCS7\[\]\!/ And the output should match /new_key1: DEC::PKCS7\[new value one\]\!/ And the output should match /new_key2: DEC::PKCS7\[new value two\]\!/ And the output should match /multi_encryption: DEC::PLAINTEXT\[jammy\]\! DEC::PKCS7\[dodger\]!/ @@ -146,7 +148,8 @@ Feature: eyaml editing When I run `bash -c 'cp test_edit.yaml test_edit.eyaml'` When I run `eyaml edit -d test_edit.eyaml` When I run `eyaml decrypt -e test_edit.eyaml` - Then the output should match /new_key1: DEC::PKCS7\[new value one\]\!/ + Then the output should match /new_key0: DEC::PKCS7\[\]\!/ + And the output should match /new_key1: DEC::PKCS7\[new value one\]\!/ And the output should match /new_key2: DEC::PKCS7\[new value two\]\!/ Scenario: no-decrypt mode should not modify existing values diff --git a/features/sandbox/test_new_values.yaml b/features/sandbox/test_new_values.yaml index 6508608d..ef4e2276 100644 --- a/features/sandbox/test_new_values.yaml +++ b/features/sandbox/test_new_values.yaml @@ -1,2 +1,3 @@ +new_key0: DEC::PKCS7[]! new_key1: DEC::PKCS7[new value one]! new_key2: DEC::PKCS7[new value two]! \ No newline at end of file