Fix and add tests for empty config file

This commit is contained in:
Micah Jerome Ellison 2022-04-30 12:00:45 -07:00 committed by GitHub
parent ca96e3175e
commit 5b589c5b2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -93,7 +93,13 @@ Feature: Multiple journals
Then the config should contain "encrypt: true" Then the config should contain "encrypt: true"
And the output should not contain "Wrong password" And the output should not contain "Wrong password"
Scenario: Use default config when configuration file is empty or corrupt Scenario: Show an error message when the config file is empty
Given we use the config "empty_file.yaml"
When we run "jrnl -1"
Then the error output should contain "Unable to parse config file"
Scenario: Show an error message when using --config-file with empty file
Given the config "empty_file.yaml" exists Given the config "empty_file.yaml" exists
And we use the config "basic_onefile.yaml"
When we run "jrnl --cf empty_file.yaml" When we run "jrnl --cf empty_file.yaml"
Then the output should contain "empty, now using default config" Then the error output should contain "Unable to parse config file"