mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-06-28 05:26:13 +02:00
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:
parent
15429d4f61
commit
65a3b2ce7c
4 changed files with 69 additions and 5 deletions
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"default_hour": 9,
|
||||
"timeformat": "%Y-%m-%d %H:%M",
|
||||
"linewrap": 80,
|
||||
"encrypt": true,
|
||||
"editor": "",
|
||||
"default_minute": 0,
|
||||
"highlight": true,
|
||||
"journals": {"default": "features/journals/encrypted_jrnl-1-9-5.journal", "missing": "features/journals/missing.journal"},
|
||||
"tagsymbols": "@"
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"default_hour": 9,
|
||||
"timeformat": "%Y-%m-%d %H:%M",
|
||||
"linewrap": 80,
|
||||
"encrypt": false,
|
||||
"editor": "",
|
||||
"default_minute": 0,
|
||||
"highlight": true,
|
||||
"journals": {"default": "features/journals/simple_jrnl-1-9-5.journal", "missing": "features/journals/missing.journal"},
|
||||
"tagsymbols": "@"
|
||||
}
|
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue