Skip to content

Commit

Permalink
Issue voxpupuli#179 Add tests for empty eyaml values
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert A. Vincent II (Bob-Vee) committed Jul 29, 2021
1 parent 75b0e20 commit ec3d47b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion features/edit.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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\]\!/

Expand Down Expand Up @@ -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\]!/
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions features/sandbox/test_new_values.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
new_key0: DEC::PKCS7[]!
new_key1: DEC::PKCS7[new value one]!
new_key2: DEC::PKCS7[new value two]!

0 comments on commit ec3d47b

Please sign in to comment.