From 5b589c5b2dc58c8a6f53b71186c5600953c98c50 Mon Sep 17 00:00:00 2001 From: Micah Jerome Ellison Date: Sat, 30 Apr 2022 12:00:45 -0700 Subject: [PATCH] Fix and add tests for empty config file --- tests/bdd/features/config_file.feature | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/bdd/features/config_file.feature b/tests/bdd/features/config_file.feature index 2eccdfca..0bba7037 100644 --- a/tests/bdd/features/config_file.feature +++ b/tests/bdd/features/config_file.feature @@ -93,7 +93,13 @@ Feature: Multiple journals 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 + 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 + And we use the config "basic_onefile.yaml" When we run "jrnl --cf empty_file.yaml" - Then the output should contain "empty, now using default config" \ No newline at end of file + Then the error output should contain "Unable to parse config file"