Fix for upgrade with missing journal (#796)

* Fix for upgrade with missing journal
* add test, refactor solution
* add missing test config

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
This commit is contained in:
dbxnr 2020-03-21 22:05:57 +00:00
parent 15429d4f61
commit 65a3b2ce7c
4 changed files with 69 additions and 5 deletions

View file

@ -38,3 +38,21 @@ Feature: Upgrading Journals from 1.x.x to 2.x.x
"""
Then the journal should have 2 entries
Scenario: Upgrade with missing journal
Given we use the config "upgrade_from_195_with_missing_journal.json"
When we run "jrnl -ls" and enter
""""
Y
"""
Then the output should contain "Error: features/journals/missing.journal does not exist."
Scenario: Upgrade with missing encrypted journal
Given we use the config "upgrade_from_195_with_missing_encrypted_journal.json"
When we run "jrnl -ls" and enter
"""
Y
bad doggie no biscuit
bad doggie no biscuit
"""
Then the output should contain "Error: features/journals/missing.journal does not exist."
and the output should contain "We're all done here"