mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-07-03 23:16:14 +02:00
Change journal name validation
Journal name validation used to happen before postconfig commands could have a chance to run, so now each command is responsible for its own error-checking of the journal name. Added a new decorator and function that makes this error-checking easier. Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
This commit is contained in:
parent
3ac2b95156
commit
2130af2e39
7 changed files with 48 additions and 12 deletions
|
@ -612,3 +612,20 @@ Feature: Custom formats
|
|||
config_path: .+basic_onefile\.yaml
|
||||
journals:
|
||||
default: features/journals/basic_onefile\.journal
|
||||
|
||||
Scenario: Export journal list to formats with no default journal
|
||||
Given we use the config "no_default_journal.yaml"
|
||||
When we run "jrnl --list"
|
||||
Then the output should match
|
||||
Journals defined in config \(.+no_default_journal\.yaml\)
|
||||
\* simple -> features/journals/simple\.journal
|
||||
\* work -> features/journals/work\.journal
|
||||
When we run "jrnl --list --format json"
|
||||
Then the output should match
|
||||
{"config_path": ".+no_default_journal\.yaml", "journals": {"simple": "features/journals/simple\.journal", "work": "features/journals/work\.journal"}}
|
||||
When we run "jrnl --list --format yaml"
|
||||
Then the output should match
|
||||
config_path: .+no_default_journal\.yaml
|
||||
journals:
|
||||
simple: features/journals/simple\.journal
|
||||
work: features/journals/work\.journal
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue