Added check for empty config file and if so, use default config

This commit is contained in:
Jonathan van der Steege 2022-04-27 17:07:57 +02:00
parent 602dad7e06
commit ca96e3175e
2 changed files with 11 additions and 1 deletions

View file

@ -85,7 +85,6 @@ Feature: Multiple journals
Then the output should contain "Journal encrypted to features/journals/basic_onefile.journal"
And the config should contain "encrypt: false"
Scenario: Don't overwrite main config when decrypting a journal in an alternate config
Given the config "editor_encrypted.yaml" exists
And we use the password "bad doggie no biscuit" if prompted
@ -93,3 +92,8 @@ Feature: Multiple journals
When we run "jrnl --cf editor_encrypted.yaml --decrypt"
Then the config should contain "encrypt: true"
And the output should not contain "Wrong password"
Scenario: Use default config when configuration file is empty or corrupt
Given the config "empty_file.yaml" exists
When we run "jrnl --cf empty_file.yaml"
Then the output should contain "empty, now using default config"