mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-06-30 22:46:12 +02:00
Merge branch 'develop' into #1170-alternate-config-file
This commit is contained in:
commit
70aa5989ea
133 changed files with 706 additions and 4869 deletions
|
@ -17,8 +17,8 @@ Feature: Delete entries from journal
|
|||
| config_file |
|
||||
| basic_onefile.yaml |
|
||||
| basic_encrypted.yaml |
|
||||
# | basic_folder.yaml | @todo
|
||||
# | basic_dayone.yaml | @todo
|
||||
| basic_folder.yaml |
|
||||
# | basic_dayone.yaml | @todo
|
||||
|
||||
|
||||
Scenario Outline: Backing out of interactive delete does not change journal
|
||||
|
@ -66,7 +66,7 @@ Feature: Delete entries from journal
|
|||
Examples: Configs
|
||||
| config_file |
|
||||
| basic_onefile.yaml |
|
||||
# | basic_folder.yaml | @todo
|
||||
| basic_folder.yaml |
|
||||
# | basic_dayone.yaml | @todo
|
||||
|
||||
|
||||
|
@ -82,7 +82,7 @@ Feature: Delete entries from journal
|
|||
Examples: Configs
|
||||
| config_file |
|
||||
| basic_onefile.yaml |
|
||||
# | basic_folder.yaml | @todo
|
||||
| basic_folder.yaml |
|
||||
# | basic_dayone.yaml | @todo
|
||||
|
||||
|
||||
|
@ -98,7 +98,7 @@ Feature: Delete entries from journal
|
|||
Examples: Configs
|
||||
| config_file |
|
||||
| basic_onefile.yaml |
|
||||
# | basic_folder.yaml | @todo
|
||||
| basic_folder.yaml |
|
||||
# | basic_dayone.yaml | @todo
|
||||
|
||||
|
||||
|
@ -114,7 +114,7 @@ Feature: Delete entries from journal
|
|||
Examples: Configs
|
||||
| config_file |
|
||||
| basic_onefile.yaml |
|
||||
# | basic_folder.yaml | @todo
|
||||
| basic_folder.yaml |
|
||||
# | basic_dayone.yaml | @todo
|
||||
|
||||
|
||||
|
@ -130,7 +130,7 @@ Feature: Delete entries from journal
|
|||
Examples: Configs
|
||||
| config_file |
|
||||
| basic_onefile.yaml |
|
||||
# | basic_folder.yaml | @todo
|
||||
| basic_folder.yaml |
|
||||
# | basic_dayone.yaml | @todo
|
||||
|
||||
|
||||
|
@ -146,7 +146,7 @@ Feature: Delete entries from journal
|
|||
Examples: Configs
|
||||
| config_file |
|
||||
| basic_onefile.yaml |
|
||||
# | basic_folder.yaml | @todo
|
||||
| basic_folder.yaml |
|
||||
# | basic_dayone.yaml | @todo
|
||||
|
||||
|
||||
|
@ -162,7 +162,7 @@ Feature: Delete entries from journal
|
|||
Examples: Configs
|
||||
| config_file |
|
||||
| basic_onefile.yaml |
|
||||
# | basic_folder.yaml | @todo
|
||||
| basic_folder.yaml |
|
||||
# | basic_dayone.yaml | @todo
|
||||
|
||||
|
||||
|
@ -178,5 +178,5 @@ Feature: Delete entries from journal
|
|||
Examples: Configs
|
||||
| config_file |
|
||||
| basic_onefile.yaml |
|
||||
# | basic_folder.yaml | @todo
|
||||
| basic_folder.yaml |
|
||||
# | basic_dayone.yaml | @todo
|
||||
|
|
|
@ -28,15 +28,37 @@ Feature: Encrypting and decrypting journals
|
|||
# This should warn the user that the journal is already encrypted
|
||||
|
||||
|
||||
Scenario: Encrypting a journal
|
||||
Scenario Outline: Encrypting a journal
|
||||
Given we use the config "simple.yaml"
|
||||
When we run "jrnl --encrypt" and enter
|
||||
swordfish
|
||||
swordfish
|
||||
n
|
||||
Then we should see the message "Journal encrypted"
|
||||
Then we should get no error
|
||||
And we should see the message "Journal encrypted"
|
||||
And the config for journal "default" should contain "encrypt: true"
|
||||
When we run "jrnl -n 1" and enter "swordfish"
|
||||
Then we should be prompted for a password
|
||||
And the output should contain "2013-06-10 15:40 Life is good"
|
||||
|
||||
|
||||
Scenario Outline: Running jrnl with encrypt: true on unencryptable journals
|
||||
Given we use the config "<config_file>"
|
||||
When we run "jrnl --config-override encrypt true here is a new entry"
|
||||
Then the error output should contain "this type of journal can't be encrypted"
|
||||
|
||||
Examples: configs
|
||||
| config_file |
|
||||
| basic_folder.yaml |
|
||||
| basic_dayone.yaml |
|
||||
|
||||
|
||||
Scenario Outline: Attempt to encrypt a folder or DayOne journal should result in an error
|
||||
Given we use the config "<config_file>"
|
||||
When we run "jrnl --encrypt"
|
||||
Then the error output should contain "can't be encrypted"
|
||||
|
||||
Examples: configs
|
||||
| config_file |
|
||||
| basic_folder.yaml |
|
||||
| basic_dayone.yaml |
|
||||
|
|
|
@ -1,5 +1,33 @@
|
|||
Feature: Custom formats
|
||||
|
||||
Scenario Outline: Short printing via --format flag
|
||||
Given we use the config "<config_file>"
|
||||
And we use the password "test" if prompted
|
||||
When we run "jrnl --format short -3"
|
||||
Then we should get no error
|
||||
|
||||
Examples: configs
|
||||
| config_file |
|
||||
| basic_onefile.yaml |
|
||||
| basic_encrypted.yaml |
|
||||
| basic_folder.yaml |
|
||||
| basic_dayone.yaml |
|
||||
|
||||
|
||||
Scenario Outline: Pretty Printing aka the Default
|
||||
Given we use the config "<config_file>"
|
||||
And we use the password "test" if prompted
|
||||
When we run "jrnl --format pretty -3"
|
||||
Then we should get no error
|
||||
|
||||
Examples: configs
|
||||
| config_file |
|
||||
| basic_onefile.yaml |
|
||||
| basic_encrypted.yaml |
|
||||
| basic_folder.yaml |
|
||||
| basic_dayone.yaml |
|
||||
|
||||
|
||||
Scenario Outline: JSON format
|
||||
Given we use the config "<config_file>"
|
||||
And we use the password "test" if prompted
|
||||
|
@ -296,6 +324,22 @@ Feature: Custom formats
|
|||
| basic_folder.yaml |
|
||||
| basic_dayone.yaml |
|
||||
|
||||
|
||||
Scenario Outline: Export fancy with small linewrap
|
||||
Given we use the config "<config_file>"
|
||||
And we use the password "test" if prompted
|
||||
When we run "jrnl --config-override linewrap 35 --format fancy -3"
|
||||
Then we should get no error
|
||||
And the output should be 35 columns wide
|
||||
|
||||
Examples: configs
|
||||
| config_file |
|
||||
| basic_onefile.yaml |
|
||||
| basic_encrypted.yaml |
|
||||
| basic_folder.yaml |
|
||||
| basic_dayone.yaml |
|
||||
|
||||
|
||||
@todo
|
||||
Scenario Outline: Exporting fancy
|
||||
# Needs better emoji support
|
||||
|
|
|
@ -11,7 +11,7 @@ Feature: Importing data
|
|||
| config_file |
|
||||
| basic_onefile.yaml |
|
||||
| basic_encrypted.yaml |
|
||||
# | basic_folder.yaml | @todo
|
||||
| basic_folder.yaml |
|
||||
# | basic_dayone.yaml | @todo
|
||||
|
||||
Scenario Outline: --import allows new large entry from stdin
|
||||
|
@ -34,7 +34,7 @@ Feature: Importing data
|
|||
| config_file |
|
||||
| basic_onefile.yaml |
|
||||
| basic_encrypted.yaml |
|
||||
# | basic_folder.yaml | @todo
|
||||
| basic_folder.yaml |
|
||||
# | basic_dayone.yaml | @todo
|
||||
|
||||
Scenario Outline: --import allows multiple new entries from stdin
|
||||
|
@ -56,7 +56,7 @@ Feature: Importing data
|
|||
| config_file |
|
||||
| basic_onefile.yaml |
|
||||
| basic_encrypted.yaml |
|
||||
# | basic_folder.yaml | @todo
|
||||
| basic_folder.yaml |
|
||||
# | basic_dayone.yaml | @todo
|
||||
|
||||
Scenario: --import allows import new entries from file
|
||||
|
|
|
@ -88,3 +88,9 @@ Feature: Multiple journals
|
|||
these three eyes
|
||||
n
|
||||
Then the output should contain "Encrypted journal 'new_encrypted' created"
|
||||
|
||||
Scenario: Read and write to journal with emoji name
|
||||
Given we use the config "multiple.yaml"
|
||||
When we run "jrnl ✨ Adding entry to sparkly journal"
|
||||
When we run "jrnl ✨ -1"
|
||||
Then the output should contain "Adding entry to sparkly journal"
|
||||
|
|
90
tests/bdd/features/override.feature
Normal file
90
tests/bdd/features/override.feature
Normal file
|
@ -0,0 +1,90 @@
|
|||
Feature: Implementing Runtime Overrides for Select Configuration Keys
|
||||
|
||||
Scenario: Override configured editor with built-in input === editor:''
|
||||
Given we use the config "basic_encrypted.yaml"
|
||||
And we use the password "test" if prompted
|
||||
When we run "jrnl --config-override editor ''"
|
||||
Then the stdin prompt should have been called
|
||||
And the editor should not have been called
|
||||
|
||||
|
||||
Scenario: Postconfig commands with overrides
|
||||
Given we use the config "basic_encrypted.yaml"
|
||||
And we use the password "test" if prompted
|
||||
When we run "jrnl --decrypt --config-override highlight false --config-override editor nano"
|
||||
Then the config in memory should contain "highlight: false"
|
||||
Then the editor should not have been called
|
||||
|
||||
|
||||
Scenario: Override configured linewrap with a value of 23
|
||||
Given we use the config "simple.yaml"
|
||||
And we use the password "test" if prompted
|
||||
When we run "jrnl -2 --config-override linewrap 23 --format fancy"
|
||||
Then the output should be
|
||||
┎─────╮2013-06-09 15:39
|
||||
┃ My ╘═══════════════╕
|
||||
┃ fir st ent ry. │
|
||||
┠╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
||||
┃ Everything is │
|
||||
┃ alright │
|
||||
┖─────────────────────┘
|
||||
┎─────╮2013-06-10 15:40
|
||||
┃ Lif ╘═══════════════╕
|
||||
┃ e is goo d. │
|
||||
┠╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
||||
┃ But I'm better. │
|
||||
┖─────────────────────┘
|
||||
|
||||
|
||||
Scenario: Override color selections with runtime overrides
|
||||
Given we use the config "basic_encrypted.yaml"
|
||||
And we use the password "test" if prompted
|
||||
When we run "jrnl -1 --config-override colors.body blue"
|
||||
Then the config in memory should contain "colors.body: blue"
|
||||
|
||||
|
||||
Scenario: Apply multiple config overrides
|
||||
Given we use the config "basic_encrypted.yaml"
|
||||
And we use the password "test" if prompted
|
||||
When we run "jrnl -1 --config-override colors.body green --config-override editor 'nano'"
|
||||
Then the config in memory should contain
|
||||
editor: nano
|
||||
colors:
|
||||
title: none
|
||||
body: green
|
||||
tags: none
|
||||
date: none
|
||||
|
||||
|
||||
Scenario: Override default journal
|
||||
Given we use the config "basic_dayone.yaml"
|
||||
And we use the password "test" if prompted
|
||||
When we run "jrnl --config-override journals.default features/journals/simple.journal 20 Mar 2000: The rain in Spain comes from clouds"
|
||||
Then we should get no error
|
||||
And we should see the message "Entry added"
|
||||
When we run "jrnl -3 --config-override journals.default features/journals/simple.journal"
|
||||
Then the output should be
|
||||
2000-03-20 09:00 The rain in Spain comes from clouds
|
||||
|
||||
2013-06-09 15:39 My first entry.
|
||||
| Everything is alright
|
||||
|
||||
2013-06-10 15:40 Life is good.
|
||||
| But I'm better.
|
||||
|
||||
|
||||
Scenario: Make an entry into an overridden journal
|
||||
Given we use the config "basic_dayone.yaml"
|
||||
And we use the password "test" if prompted
|
||||
When we run "jrnl --config-override journals.temp features/journals/simple.journal temp Sep 06 1969: @say Ni"
|
||||
Then we should get no error
|
||||
And we should see the message "Entry added"
|
||||
When we run "jrnl --config-override journals.temp features/journals/simple.journal temp -3"
|
||||
Then the output should be
|
||||
1969-09-06 09:00 @say Ni
|
||||
|
||||
2013-06-09 15:39 My first entry.
|
||||
| Everything is alright
|
||||
|
||||
2013-06-10 15:40 Life is good.
|
||||
| But I'm better.
|
Loading…
Add table
Add a link
Reference in a new issue