From cabbbea6944e5a970f93ce6e5c299e7efede3d0a Mon Sep 17 00:00:00 2001 From: Manuel Ebert Date: Sun, 3 Nov 2013 14:38:41 -1000 Subject: [PATCH] Tests for fixing errors automatically --- features/data/configs/broken.json | 15 +++++++++++++++ features/fix_json.feature | 14 ++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 features/data/configs/broken.json create mode 100644 features/fix_json.feature diff --git a/features/data/configs/broken.json b/features/data/configs/broken.json new file mode 100644 index 00000000..bcd96f24 --- /dev/null +++ b/features/data/configs/broken.json @@ -0,0 +1,15 @@ +{ + "default_hour": 9, + "timeformat": "%Y-%m-%d %H:%M", + "linewrap": 80, + "encrypt": false, + "editor": "", + "default_minute": 0, + "highlight": true + "password": "", + "journals": { + "default": "features/journals/simple.journal" + "work": "features/journals/work.journal", + }, + "tagsymbols": "@" +} diff --git a/features/fix_json.feature b/features/fix_json.feature new file mode 100644 index 00000000..84f91955 --- /dev/null +++ b/features/fix_json.feature @@ -0,0 +1,14 @@ +Feature: Fixing broken config files + + Scenario: Loading a file with journal + Given we use the config "broken.json" + When we run "jrnl -n 2" + Then we should see the message "Some errors in your jrnl config have been fixed for you." + and the output should be + """ + 2013-06-09 15:39 My first entry. + | Everything is alright + + 2013-06-10 15:40 Life is good. + | But I'm better. + """