From d27b95b9631ae5c67c738233014fe4423016320a Mon Sep 17 00:00:00 2001 From: Micah Jerome Ellison Date: Sat, 23 Apr 2022 13:37:53 -0700 Subject: [PATCH] Add test for user-friendly error when exporting YAML to a nonexistent directory --- tests/bdd/features/format.feature | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/bdd/features/format.feature b/tests/bdd/features/format.feature index dc5c92ca..412251ef 100644 --- a/tests/bdd/features/format.feature +++ b/tests/bdd/features/format.feature @@ -425,6 +425,20 @@ Feature: Custom formats | basic_folder.yaml | # | basic_dayone.yaml | + Scenario Outline: Exporting YAML to nonexistent directory leads to user-friendly error with no traceback + Given we use the config "" + And we use the password "test" if prompted + When we run "jrnl --export yaml --file nonexistent_dir" + Then the output should contain "YAML export must be to individual files" + And the output should not contain "Traceback" + + Examples: configs + | config_file | + | basic_onefile.yaml | + | basic_encrypted.yaml | + | basic_folder.yaml | + # | basic_dayone.yaml | @todo + @skip_win # @todo YAML exporter does not correctly export emoji on Windows Scenario Outline: Add a blank line to YAML export if there isn't one already # https://github.com/jrnl-org/jrnl/issues/768