Encapsulate all multiline strings in triple-quotes in Gherkin files

Since pytest-bdd v8.0.0 uses the official Gherkin parser, multiline
strings must now be encapsulated by triple-quotes.

See:
- https://pytest-bdd.readthedocs.io/en/stable/#id2
- https://pytest-bdd.readthedocs.io/en/stable/#docstrings
This commit is contained in:
Carl Smedstad 2024-11-16 15:33:07 +01:00
parent eb5fe6fef1
commit 5f937721bf
No known key found for this signature in database
GPG key ID: 49C93367BA86290E
18 changed files with 344 additions and 11 deletions

View file

@ -8,16 +8,20 @@ Feature: Test combinations of edit, change-time, and delete
And we write nothing to the editor if opened And we write nothing to the editor if opened
And we use the password "test" if prompted And we use the password "test" if prompted
When we run "jrnl --change-time '2022-04-23 10:30' --edit" and enter When we run "jrnl --change-time '2022-04-23 10:30' --edit" and enter
"""
Y Y
N N
Y Y
"""
Then the error output should contain "No text received from editor. Were you trying to delete all the entries?" Then the error output should contain "No text received from editor. Were you trying to delete all the entries?"
And the editor should have been called And the editor should have been called
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
"""
2020-08-31 14:32 A second entry in what I hope to be a long series. 2020-08-31 14:32 A second entry in what I hope to be a long series.
2022-04-23 10:30 Entry the first. 2022-04-23 10:30 Entry the first.
2022-04-23 10:30 The third entry finally after weeks without writing. 2022-04-23 10:30 The third entry finally after weeks without writing.
"""
Examples: Configs Examples: Configs
| config_file | | config_file |
@ -29,12 +33,16 @@ Feature: Test combinations of edit, change-time, and delete
Scenario Outline: --delete with --edit deletes selected entries Scenario Outline: --delete with --edit deletes selected entries
Given we use the config "<config_file>" Given we use the config "<config_file>"
And we append to the editor if opened And we append to the editor if opened
"""
[2023-02-21 10:32] Here is a new entry [2023-02-21 10:32] Here is a new entry
"""
And we use the password "test" if prompted And we use the password "test" if prompted
When we run "jrnl --delete --edit" and enter When we run "jrnl --delete --edit" and enter
"""
Y Y
N N
Y Y
"""
Then the editor should have been called Then the editor should have been called
And the error output should contain "3 entries found" And the error output should contain "3 entries found"
And the error output should contain "2 entries deleted" And the error output should contain "2 entries deleted"
@ -42,8 +50,10 @@ Feature: Test combinations of edit, change-time, and delete
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the error output should contain "2 entries found" Then the error output should contain "2 entries found"
And the output should be And the output should be
"""
2020-08-31 14:32 A second entry in what I hope to be a long series. 2020-08-31 14:32 A second entry in what I hope to be a long series.
2023-02-21 10:32 Here is a new entry 2023-02-21 10:32 Here is a new entry
"""
Examples: Configs Examples: Configs
| config_file | | config_file |
@ -57,19 +67,23 @@ Feature: Test combinations of edit, change-time, and delete
And we use the password "test" if prompted And we use the password "test" if prompted
# --change-time is asked first, then --delete # --change-time is asked first, then --delete
When we run "jrnl --change-time '2022-04-23 10:30' --delete" and enter When we run "jrnl --change-time '2022-04-23 10:30' --delete" and enter
"""
N N
N N
Y Y
Y Y
N N
N N
"""
Then the error output should contain "3 entries found" Then the error output should contain "3 entries found"
And the error output should contain "1 entry deleted" And the error output should contain "1 entry deleted"
And the error output should contain "1 entry modified" And the error output should contain "1 entry modified"
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
"""
2020-08-31 14:32 A second entry in what I hope to be a long series. 2020-08-31 14:32 A second entry in what I hope to be a long series.
2022-04-23 10:30 The third entry finally after weeks without writing. 2022-04-23 10:30 The third entry finally after weeks without writing.
"""
Examples: Configs Examples: Configs
| config_file | | config_file |
@ -81,24 +95,30 @@ Feature: Test combinations of edit, change-time, and delete
Scenario Outline: Combining --change-time and --delete and --edit affects appropriate entries Scenario Outline: Combining --change-time and --delete and --edit affects appropriate entries
Given we use the config "<config_file>" Given we use the config "<config_file>"
And we append to the editor if opened And we append to the editor if opened
"""
[2023-02-21 10:32] Here is a new entry [2023-02-21 10:32] Here is a new entry
"""
And we use the password "test" if prompted And we use the password "test" if prompted
# --change-time is asked first, then --delete, then --edit # --change-time is asked first, then --delete, then --edit
When we run "jrnl --change-time '2022-04-23 10:30' --delete --edit" and enter When we run "jrnl --change-time '2022-04-23 10:30' --delete --edit" and enter
"""
N N
Y Y
Y Y
Y Y
Y Y
N N
"""
Then the error output should contain "3 entries found" Then the error output should contain "3 entries found"
And the error output should contain "2 entries deleted" And the error output should contain "2 entries deleted"
And the error output should contain "1 entry modified" # only 1, because the other was deleted And the error output should contain "1 entry modified" # only 1, because the other was deleted
And the error output should contain "1 entry added" # by edit And the error output should contain "1 entry added" # by edit
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
"""
2022-04-23 10:30 The third entry finally after weeks without writing. 2022-04-23 10:30 The third entry finally after weeks without writing.
2023-02-21 10:32 Here is a new entry 2023-02-21 10:32 Here is a new entry
"""
Examples: Configs Examples: Configs
| config_file | | config_file |

View file

@ -8,14 +8,18 @@ Feature: Change entry times in journal
When we run "jrnl -1" When we run "jrnl -1"
Then the output should contain "2020-09-24 09:14 The third entry finally" Then the output should contain "2020-09-24 09:14 The third entry finally"
When we run "jrnl -1 --change-time '2022-04-23 10:30'" and enter When we run "jrnl -1 --change-time '2022-04-23 10:30'" and enter
"""
Y Y
"""
Then the error output should contain "1 entry modified" Then the error output should contain "1 entry modified"
And the error output should not contain "deleted" And the error output should not contain "deleted"
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
"""
2020-08-29 11:11 Entry the first. 2020-08-29 11:11 Entry the first.
2020-08-31 14:32 A second entry in what I hope to be a long series. 2020-08-31 14:32 A second entry in what I hope to be a long series.
2022-04-23 10:30 The third entry finally after weeks without writing. 2022-04-23 10:30 The third entry finally after weeks without writing.
"""
Examples: Configs Examples: Configs
| config_file | | config_file |
@ -29,20 +33,26 @@ Feature: Change entry times in journal
And we use the password "test" if prompted And we use the password "test" if prompted
When we run "jrnl --short" When we run "jrnl --short"
Then the output should be Then the output should be
"""
2020-08-29 11:11 Entry the first. 2020-08-29 11:11 Entry the first.
2020-08-31 14:32 A second entry in what I hope to be a long series. 2020-08-31 14:32 A second entry in what I hope to be a long series.
2020-09-24 09:14 The third entry finally after weeks without writing. 2020-09-24 09:14 The third entry finally after weeks without writing.
"""
When we run "jrnl --change-time '2022-04-23 10:30'" and enter When we run "jrnl --change-time '2022-04-23 10:30'" and enter
"""
Y Y
N N
Y Y
"""
Then the error output should contain "3 entries found" Then the error output should contain "3 entries found"
And the error output should contain "2 entries modified" And the error output should contain "2 entries modified"
When we run "jrnl --short" When we run "jrnl --short"
Then the output should be Then the output should be
"""
2020-08-31 14:32 A second entry in what I hope to be a long series. 2020-08-31 14:32 A second entry in what I hope to be a long series.
2022-04-23 10:30 Entry the first. 2022-04-23 10:30 Entry the first.
2022-04-23 10:30 The third entry finally after weeks without writing. 2022-04-23 10:30 The third entry finally after weeks without writing.
"""
Examples: Configs Examples: Configs
| config_file | | config_file |
@ -58,14 +68,18 @@ Feature: Change entry times in journal
When we run "jrnl -1" When we run "jrnl -1"
Then the output should contain "2020-09-24 09:14 The third entry finally" Then the output should contain "2020-09-24 09:14 The third entry finally"
When we run "jrnl -1 --change-time '2023-02-21 10:30'" and enter When we run "jrnl -1 --change-time '2023-02-21 10:30'" and enter
"""
N N
"""
Then the error output should not contain "modified" Then the error output should not contain "modified"
And the error output should not contain "deleted" And the error output should not contain "deleted"
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
"""
2020-08-29 11:11 Entry the first. 2020-08-29 11:11 Entry the first.
2020-08-31 14:32 A second entry in what I hope to be a long series. 2020-08-31 14:32 A second entry in what I hope to be a long series.
2020-09-24 09:14 The third entry finally after weeks without writing. 2020-09-24 09:14 The third entry finally after weeks without writing.
"""
Examples: Configs Examples: Configs
| config_file | | config_file |
@ -83,9 +97,11 @@ Feature: Change entry times in journal
And the error output should not contain "entries deleted" And the error output should not contain "entries deleted"
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
"""
2020-08-29 11:11 Entry the first. 2020-08-29 11:11 Entry the first.
2020-08-31 14:32 A second entry in what I hope to be a long series. 2020-08-31 14:32 A second entry in what I hope to be a long series.
2020-09-24 09:14 The third entry finally after weeks without writing. 2020-09-24 09:14 The third entry finally after weeks without writing.
"""
Examples: Configs Examples: Configs
| config_file | | config_file |
@ -99,14 +115,18 @@ Feature: Change entry times in journal
Given we use the config "<config_file>" Given we use the config "<config_file>"
And we use the password "test" if prompted And we use the password "test" if prompted
When we run "jrnl --change-time '2022-04-23 10:30' @ipsum" and enter When we run "jrnl --change-time '2022-04-23 10:30' @ipsum" and enter
"""
Y Y
"""
Then the error output should contain "1 entry found" Then the error output should contain "1 entry found"
And the error output should contain "1 entry modified" And the error output should contain "1 entry modified"
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
"""
2020-08-31 14:32 A second entry in what I hope to be a long series. 2020-08-31 14:32 A second entry in what I hope to be a long series.
2020-09-24 09:14 The third entry finally after weeks without writing. 2020-09-24 09:14 The third entry finally after weeks without writing.
2022-04-23 10:30 Entry the first. 2022-04-23 10:30 Entry the first.
"""
Examples: Configs Examples: Configs
| config_file | | config_file |
@ -120,13 +140,17 @@ Feature: Change entry times in journal
Given we use the config "<config_file>" Given we use the config "<config_file>"
And we use the password "test" if prompted And we use the password "test" if prompted
When we run "jrnl --change-time '2022-04-23 10:30' @ipsum @tagthree" and enter When we run "jrnl --change-time '2022-04-23 10:30' @ipsum @tagthree" and enter
"""
Y Y
Y Y
"""
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
"""
2020-08-31 14:32 A second entry in what I hope to be a long series. 2020-08-31 14:32 A second entry in what I hope to be a long series.
2022-04-23 10:30 Entry the first. 2022-04-23 10:30 Entry the first.
2022-04-23 10:30 The third entry finally after weeks without writing. 2022-04-23 10:30 The third entry finally after weeks without writing.
"""
Examples: Configs Examples: Configs
| config_file | | config_file |
@ -140,12 +164,16 @@ Feature: Change entry times in journal
Given we use the config "<config_file>" Given we use the config "<config_file>"
And we use the password "test" if prompted And we use the password "test" if prompted
When we run "jrnl --change-time '2022-04-23 10:30' -and @tagone @tagtwo" and enter When we run "jrnl --change-time '2022-04-23 10:30' -and @tagone @tagtwo" and enter
"""
Y Y
"""
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
"""
2020-08-31 14:32 A second entry in what I hope to be a long series. 2020-08-31 14:32 A second entry in what I hope to be a long series.
2020-09-24 09:14 The third entry finally after weeks without writing. 2020-09-24 09:14 The third entry finally after weeks without writing.
2022-04-23 10:30 Entry the first. 2022-04-23 10:30 Entry the first.
"""
Examples: Configs Examples: Configs
| config_file | | config_file |
@ -159,12 +187,16 @@ Feature: Change entry times in journal
Given we use the config "<config_file>" Given we use the config "<config_file>"
And we use the password "test" if prompted And we use the password "test" if prompted
When we run "jrnl --change-time '2022-04-23 10:30' @tagone -not @ipsum" and enter When we run "jrnl --change-time '2022-04-23 10:30' @tagone -not @ipsum" and enter
"""
Y Y
"""
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
"""
2020-08-29 11:11 Entry the first. 2020-08-29 11:11 Entry the first.
2020-08-31 14:32 A second entry in what I hope to be a long series. 2020-08-31 14:32 A second entry in what I hope to be a long series.
2022-04-23 10:30 The third entry finally after weeks without writing. 2022-04-23 10:30 The third entry finally after weeks without writing.
"""
Examples: Configs Examples: Configs
| config_file | | config_file |
@ -178,12 +210,16 @@ Feature: Change entry times in journal
Given we use the config "<config_file>" Given we use the config "<config_file>"
And we use the password "test" if prompted And we use the password "test" if prompted
When we run "jrnl --change-time '2022-04-23 10:30' -from 2020-09-01" and enter When we run "jrnl --change-time '2022-04-23 10:30' -from 2020-09-01" and enter
"""
Y Y
"""
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
"""
2020-08-29 11:11 Entry the first. 2020-08-29 11:11 Entry the first.
2020-08-31 14:32 A second entry in what I hope to be a long series. 2020-08-31 14:32 A second entry in what I hope to be a long series.
2022-04-23 10:30 The third entry finally after weeks without writing. 2022-04-23 10:30 The third entry finally after weeks without writing.
"""
Examples: Configs Examples: Configs
| config_file | | config_file |
@ -197,13 +233,17 @@ Feature: Change entry times in journal
Given we use the config "<config_file>" Given we use the config "<config_file>"
And we use the password "test" if prompted And we use the password "test" if prompted
When we run "jrnl --change-time '2022-04-23 10:30' -to 2020-08-31" and enter When we run "jrnl --change-time '2022-04-23 10:30' -to 2020-08-31" and enter
"""
Y Y
Y Y
"""
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
"""
2020-09-24 09:14 The third entry finally after weeks without writing. 2020-09-24 09:14 The third entry finally after weeks without writing.
2022-04-23 10:30 Entry the first. 2022-04-23 10:30 Entry the first.
2022-04-23 10:30 A second entry in what I hope to be a long series. 2022-04-23 10:30 A second entry in what I hope to be a long series.
"""
Examples: Configs Examples: Configs
| config_file | | config_file |
@ -217,12 +257,16 @@ Feature: Change entry times in journal
Given we use the config "<config_file>" Given we use the config "<config_file>"
And we use the password "test" if prompted And we use the password "test" if prompted
When we run "jrnl --change-time '2022-04-23 10:30' -starred" and enter When we run "jrnl --change-time '2022-04-23 10:30' -starred" and enter
"""
Y Y
"""
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
"""
2020-08-29 11:11 Entry the first. 2020-08-29 11:11 Entry the first.
2020-09-24 09:14 The third entry finally after weeks without writing. 2020-09-24 09:14 The third entry finally after weeks without writing.
2022-04-23 10:30 A second entry in what I hope to be a long series. 2022-04-23 10:30 A second entry in what I hope to be a long series.
"""
Examples: Configs Examples: Configs
| config_file | | config_file |
@ -236,13 +280,17 @@ Feature: Change entry times in journal
Given we use the config "<config_file>" Given we use the config "<config_file>"
And we use the password "test" if prompted And we use the password "test" if prompted
When we run "jrnl --change-time '2022-04-23 10:30' -contains dignissim" and enter When we run "jrnl --change-time '2022-04-23 10:30' -contains dignissim" and enter
"""
Y Y
"""
Then the error output should contain "1 entry modified" Then the error output should contain "1 entry modified"
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
"""
2020-08-31 14:32 A second entry in what I hope to be a long series. 2020-08-31 14:32 A second entry in what I hope to be a long series.
2020-09-24 09:14 The third entry finally after weeks without writing. 2020-09-24 09:14 The third entry finally after weeks without writing.
2022-04-23 10:30 Entry the first. 2022-04-23 10:30 Entry the first.
"""
Examples: Configs Examples: Configs
| config_file | | config_file |
@ -256,14 +304,18 @@ Feature: Change entry times in journal
Given we use the config "<config_file>" Given we use the config "<config_file>"
And we use the password "test" if prompted And we use the password "test" if prompted
When we run "jrnl --change-time" and enter When we run "jrnl --change-time" and enter
"""
N N
N N
N N
"""
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
"""
2020-08-29 11:11 Entry the first. 2020-08-29 11:11 Entry the first.
2020-08-31 14:32 A second entry in what I hope to be a long series. 2020-08-31 14:32 A second entry in what I hope to be a long series.
2020-09-24 09:14 The third entry finally after weeks without writing. 2020-09-24 09:14 The third entry finally after weeks without writing.
"""
Examples: Configs Examples: Configs
| config_file | | config_file |

View file

@ -73,18 +73,22 @@ Feature: Multiple journals
Given the config "multiple.yaml" exists Given the config "multiple.yaml" exists
And we use the config "basic_onefile.yaml" And we use the config "basic_onefile.yaml"
When we run "jrnl new_encrypted --cf multiple.yaml Adding first entry" and enter When we run "jrnl new_encrypted --cf multiple.yaml Adding first entry" and enter
"""
these three eyes these three eyes
these three eyes these three eyes
n n
"""
Then the output should contain "Journal 'new_encrypted' created at " Then the output should contain "Journal 'new_encrypted' created at "
Scenario: Don't overwrite main config when encrypting a journal in an alternate config Scenario: Don't overwrite main config when encrypting a journal in an alternate config
Given the config "basic_onefile.yaml" exists Given the config "basic_onefile.yaml" exists
And we use the config "multiple.yaml" And we use the config "multiple.yaml"
When we run "jrnl --cf basic_onefile.yaml --encrypt" and enter When we run "jrnl --cf basic_onefile.yaml --encrypt" and enter
"""
these three eyes these three eyes
these three eyes these three eyes
n n
"""
Then the output should contain "Journal encrypted to features/journals/basic_onefile.journal" Then the output should contain "Journal encrypted to features/journals/basic_onefile.journal"
And the config should contain "encrypt: false" And the config should contain "encrypt: false"

View file

@ -27,11 +27,13 @@ Feature: Reading and writing to journal with custom date formats
Then we should get no error Then we should get no error
When we run "jrnl -n 999" When we run "jrnl -n 999"
Then the output should be Then the output should be
"""
09.06.2013 15:39 My first entry. 09.06.2013 15:39 My first entry.
| Everything is alright | Everything is alright
10.07.2013 15:40 Life is good. 10.07.2013 15:40 Life is good.
| But I'm better. | But I'm better.
"""
Scenario Outline: Writing an entry from command line with custom date Scenario Outline: Writing an entry from command line with custom date
@ -142,9 +144,11 @@ Feature: Reading and writing to journal with custom date formats
Given we use the config "mostlyreadabledates.yaml" Given we use the config "mostlyreadabledates.yaml"
When we run "jrnl --short" When we run "jrnl --short"
Then the output should be Then the output should be
"""
2019-07-01 14:23 The third entry 2019-07-01 14:23 The third entry
2019-07-18 14:23 The first entry 2019-07-18 14:23 The first entry
2019-07-19 14:23 The second entry 2019-07-19 14:23 The second entry
"""
Scenario: Update near-valid dates after journal is edited Scenario: Update near-valid dates after journal is edited
@ -175,7 +179,9 @@ Feature: Reading and writing to journal with custom date formats
When we run "jrnl -1" When we run "jrnl -1"
Then we should get no error Then we should get no error
And the output should be And the output should be
"""
2013-10-27 04:27 Some text. 2013-10-27 04:27 Some text.
"""
@skip #1422 @skip #1422

View file

@ -8,15 +8,19 @@ Feature: Delete entries from journal
When we run "jrnl -1" When we run "jrnl -1"
Then the output should contain "2020-09-24 09:14 The third entry finally" Then the output should contain "2020-09-24 09:14 The third entry finally"
When we run "jrnl --delete" and enter When we run "jrnl --delete" and enter
"""
N N
N N
Y Y
"""
Then the error output should contain "3 entries found" Then the error output should contain "3 entries found"
And the error output should contain "1 entry deleted" And the error output should contain "1 entry deleted"
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
"""
2020-08-29 11:11 Entry the first. 2020-08-29 11:11 Entry the first.
2020-08-31 14:32 A second entry in what I hope to be a long series. 2020-08-31 14:32 A second entry in what I hope to be a long series.
"""
Examples: Configs Examples: Configs
| config_file | | config_file |
@ -29,13 +33,17 @@ Feature: Delete entries from journal
Scenario Outline: Backing out of interactive delete does not change journal Scenario Outline: Backing out of interactive delete does not change journal
Given we use the config "<config_file>" Given we use the config "<config_file>"
When we run "jrnl --delete -n 1" and enter When we run "jrnl --delete -n 1" and enter
"""
N N
"""
Then the error output should not contain "deleted" Then the error output should not contain "deleted"
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
"""
2020-08-29 11:11 Entry the first. 2020-08-29 11:11 Entry the first.
2020-08-31 14:32 A second entry in what I hope to be a long series. 2020-08-31 14:32 A second entry in what I hope to be a long series.
2020-09-24 09:14 The third entry finally after weeks without writing. 2020-09-24 09:14 The third entry finally after weeks without writing.
"""
Examples: Configs Examples: Configs
| config_file | | config_file |
@ -50,9 +58,11 @@ Feature: Delete entries from journal
Then the error output should contain "No entries to delete" Then the error output should contain "No entries to delete"
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
"""
2020-08-29 11:11 Entry the first. 2020-08-29 11:11 Entry the first.
2020-08-31 14:32 A second entry in what I hope to be a long series. 2020-08-31 14:32 A second entry in what I hope to be a long series.
2020-09-24 09:14 The third entry finally after weeks without writing. 2020-09-24 09:14 The third entry finally after weeks without writing.
"""
Examples: Configs Examples: Configs
| config_file | | config_file |
@ -64,13 +74,17 @@ Feature: Delete entries from journal
Scenario Outline: Delete flag with tag only deletes tagged entries Scenario Outline: Delete flag with tag only deletes tagged entries
Given we use the config "<config_file>" Given we use the config "<config_file>"
When we run "jrnl --delete @ipsum" and enter When we run "jrnl --delete @ipsum" and enter
"""
Y Y
"""
Then the error output should contain "1 entry found" Then the error output should contain "1 entry found"
Then the error output should contain "1 entry deleted" Then the error output should contain "1 entry deleted"
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
"""
2020-08-31 14:32 A second entry in what I hope to be a long series. 2020-08-31 14:32 A second entry in what I hope to be a long series.
2020-09-24 09:14 The third entry finally after weeks without writing. 2020-09-24 09:14 The third entry finally after weeks without writing.
"""
Examples: Configs Examples: Configs
| config_file | | config_file |
@ -82,13 +96,17 @@ Feature: Delete entries from journal
Scenario Outline: Delete flag with multiple tags deletes all entries matching any of the tags Scenario Outline: Delete flag with multiple tags deletes all entries matching any of the tags
Given we use the config "<config_file>" Given we use the config "<config_file>"
When we run "jrnl --delete @ipsum @tagthree" and enter When we run "jrnl --delete @ipsum @tagthree" and enter
"""
Y Y
Y Y
"""
Then the error output should contain "2 entries found" Then the error output should contain "2 entries found"
And the error output should contain "2 entries deleted" And the error output should contain "2 entries deleted"
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
"""
2020-08-31 14:32 A second entry in what I hope to be a long series. 2020-08-31 14:32 A second entry in what I hope to be a long series.
"""
Examples: Configs Examples: Configs
| config_file | | config_file |
@ -100,13 +118,17 @@ Feature: Delete entries from journal
Scenario Outline: Delete flag with -and deletes boolean AND of tagged entries Scenario Outline: Delete flag with -and deletes boolean AND of tagged entries
Given we use the config "<config_file>" Given we use the config "<config_file>"
When we run "jrnl --delete -and @tagone @tagtwo" and enter When we run "jrnl --delete -and @tagone @tagtwo" and enter
"""
Y Y
"""
Then the error output should contain "1 entry found" Then the error output should contain "1 entry found"
And the error output should contain "1 entry deleted" And the error output should contain "1 entry deleted"
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
"""
2020-08-31 14:32 A second entry in what I hope to be a long series. 2020-08-31 14:32 A second entry in what I hope to be a long series.
2020-09-24 09:14 The third entry finally after weeks without writing. 2020-09-24 09:14 The third entry finally after weeks without writing.
"""
Examples: Configs Examples: Configs
| config_file | | config_file |
@ -118,13 +140,17 @@ Feature: Delete entries from journal
Scenario Outline: Delete flag with -not does not delete entries from given tag Scenario Outline: Delete flag with -not does not delete entries from given tag
Given we use the config "<config_file>" Given we use the config "<config_file>"
When we run "jrnl --delete @tagone -not @ipsum" and enter When we run "jrnl --delete @tagone -not @ipsum" and enter
"""
Y Y
"""
Then the error output should contain "1 entry found" Then the error output should contain "1 entry found"
And the error output should contain "1 entry deleted" And the error output should contain "1 entry deleted"
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
"""
2020-08-29 11:11 Entry the first. 2020-08-29 11:11 Entry the first.
2020-08-31 14:32 A second entry in what I hope to be a long series. 2020-08-31 14:32 A second entry in what I hope to be a long series.
"""
Examples: Configs Examples: Configs
| config_file | | config_file |
@ -136,13 +162,17 @@ Feature: Delete entries from journal
Scenario Outline: Delete flag with -from search operator only deletes entries since that date Scenario Outline: Delete flag with -from search operator only deletes entries since that date
Given we use the config "<config_file>" Given we use the config "<config_file>"
When we run "jrnl --delete -from 2020-09-01" and enter When we run "jrnl --delete -from 2020-09-01" and enter
"""
Y Y
"""
Then the error output should contain "1 entry found" Then the error output should contain "1 entry found"
And the error output should contain "1 entry deleted" And the error output should contain "1 entry deleted"
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
"""
2020-08-29 11:11 Entry the first. 2020-08-29 11:11 Entry the first.
2020-08-31 14:32 A second entry in what I hope to be a long series. 2020-08-31 14:32 A second entry in what I hope to be a long series.
"""
Examples: Configs Examples: Configs
| config_file | | config_file |
@ -154,13 +184,17 @@ Feature: Delete entries from journal
Scenario Outline: Delete flag with -to only deletes entries up to specified date Scenario Outline: Delete flag with -to only deletes entries up to specified date
Given we use the config "<config_file>" Given we use the config "<config_file>"
When we run "jrnl --delete -to 2020-08-31" and enter When we run "jrnl --delete -to 2020-08-31" and enter
"""
Y Y
Y Y
"""
Then the error output should contain "2 entries found" Then the error output should contain "2 entries found"
And the error output should contain "2 entries deleted" And the error output should contain "2 entries deleted"
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
"""
2020-09-24 09:14 The third entry finally after weeks without writing. 2020-09-24 09:14 The third entry finally after weeks without writing.
"""
Examples: Configs Examples: Configs
| config_file | | config_file |
@ -172,12 +206,16 @@ Feature: Delete entries from journal
Scenario Outline: Delete flag with -starred only deletes starred entries Scenario Outline: Delete flag with -starred only deletes starred entries
Given we use the config "<config_file>" Given we use the config "<config_file>"
When we run "jrnl --delete -starred" and enter When we run "jrnl --delete -starred" and enter
"""
Y Y
"""
Then the error output should contain "1 entry deleted" Then the error output should contain "1 entry deleted"
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
"""
2020-08-29 11:11 Entry the first. 2020-08-29 11:11 Entry the first.
2020-09-24 09:14 The third entry finally after weeks without writing. 2020-09-24 09:14 The third entry finally after weeks without writing.
"""
Examples: Configs Examples: Configs
| config_file | | config_file |
@ -189,13 +227,17 @@ Feature: Delete entries from journal
Scenario Outline: Delete flag with -contains only entries containing expression Scenario Outline: Delete flag with -contains only entries containing expression
Given we use the config "<config_file>" Given we use the config "<config_file>"
When we run "jrnl --delete -contains dignissim" and enter When we run "jrnl --delete -contains dignissim" and enter
"""
Y Y
"""
Then the error output should contain "1 entry found" Then the error output should contain "1 entry found"
And the error output should contain "1 entry deleted" And the error output should contain "1 entry deleted"
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
"""
2020-08-31 14:32 A second entry in what I hope to be a long series. 2020-08-31 14:32 A second entry in what I hope to be a long series.
2020-09-24 09:14 The third entry finally after weeks without writing. 2020-09-24 09:14 The third entry finally after weeks without writing.
"""
Examples: Configs Examples: Configs
| config_file | | config_file |

View file

@ -11,8 +11,10 @@ Feature: Encrypting and decrypting journals
And the config for journal "default" should contain "encrypt: false" And the config for journal "default" should contain "encrypt: false"
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
"""
2013-06-09 15:39 My first entry. 2013-06-09 15:39 My first entry.
2013-06-10 15:40 Life is good. 2013-06-10 15:40 Life is good.
"""
@todo @todo
@ -23,8 +25,10 @@ Feature: Encrypting and decrypting journals
Then the config for journal "default" should contain "encrypt: false" Then the config for journal "default" should contain "encrypt: false"
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
"""
2013-06-09 15:39 My first entry. 2013-06-09 15:39 My first entry.
2013-06-10 15:40 Life is good. 2013-06-10 15:40 Life is good.
"""
Scenario: Trying to encrypt an already encrypted journal Scenario: Trying to encrypt an already encrypted journal
@ -36,9 +40,11 @@ Feature: Encrypting and decrypting journals
Scenario Outline: Encrypting a journal Scenario Outline: Encrypting a journal
Given we use the config "simple.yaml" Given we use the config "simple.yaml"
When we run "jrnl --encrypt" and enter When we run "jrnl --encrypt" and enter
"""
swordfish swordfish
swordfish swordfish
n n
"""
Then we should get no error Then we should get no error
And the output should contain "Journal encrypted" And the output should contain "Journal encrypted"
And the config for journal "default" should contain "encrypt: true" And the config for journal "default" should contain "encrypt: true"
@ -50,16 +56,20 @@ Feature: Encrypting and decrypting journals
Given we use the config "simple.yaml" Given we use the config "simple.yaml"
And we don't have a keyring And we don't have a keyring
When we run "jrnl --encrypt" and enter When we run "jrnl --encrypt" and enter
"""
swordfish swordfish
swordfish swordfish
y y
"""
Then we should get no error Then we should get no error
And the output should contain "Journal encrypted" And the output should contain "Journal encrypted"
When we run "jrnl --encrypt" and enter When we run "jrnl --encrypt" and enter
"""
swordfish swordfish
tuna tuna
tuna tuna
y y
"""
Then we should get no error Then we should get no error
And the output should contain "Journal default is already encrypted. Create a new password." And the output should contain "Journal default is already encrypted. Create a new password."
And we should be prompted for a password And we should be prompted for a password
@ -69,15 +79,19 @@ Feature: Encrypting and decrypting journals
Given we use the config "simple.yaml" Given we use the config "simple.yaml"
And we have a keyring And we have a keyring
When we run "jrnl --encrypt" and enter When we run "jrnl --encrypt" and enter
"""
swordfish swordfish
swordfish swordfish
y y
"""
Then we should get no error Then we should get no error
And the output should contain "Journal encrypted" And the output should contain "Journal encrypted"
When we run "jrnl --encrypt" and enter When we run "jrnl --encrypt" and enter
"""
tuna tuna
tuna tuna
y y
"""
Then we should get no error Then we should get no error
And the output should contain "Journal default is already encrypted. Create a new password." And the output should contain "Journal default is already encrypted. Create a new password."
And we should be prompted for a password And we should be prompted for a password

View file

@ -8,7 +8,9 @@ Feature: Journals iteracting with the file system in a way that users can see
When we run "jrnl 23 July 2013: Testing folder journal." When we run "jrnl 23 July 2013: Testing folder journal."
Then we should get no error Then we should get no error
And the journal directory should contain And the journal directory should contain
"""
2013/07/23.txt 2013/07/23.txt
"""
Scenario: Adding multiple entries to a Folder journal should generate multiple date files Scenario: Adding multiple entries to a Folder journal should generate multiple date files
Given we use the config "empty_folder.yaml" Given we use the config "empty_folder.yaml"
@ -16,7 +18,9 @@ Feature: Journals iteracting with the file system in a way that users can see
And we run "jrnl 3/7/2014: Second entry of journal." And we run "jrnl 3/7/2014: Second entry of journal."
Then we should get no error Then we should get no error
And the journal directory should contain And the journal directory should contain
"""
2013/07/23.txt 2013/07/23.txt
"""
Scenario: If the journal and its parent directory don't exist, they should be created Scenario: If the journal and its parent directory don't exist, they should be created
Given we use the config "missing_directory.yaml" Given we use the config "missing_directory.yaml"
@ -55,9 +59,11 @@ Feature: Journals iteracting with the file system in a way that users can see
Scenario: Creating journal with relative path should update to absolute path Scenario: Creating journal with relative path should update to absolute path
Given we use no config Given we use no config
When we run "jrnl hello world" and enter When we run "jrnl hello world" and enter
"""
test.txt test.txt
n n
\n \n
"""
Then the output should contain "Journal 'default' created" Then the output should contain "Journal 'default' created"
When we change directory to "subfolder" When we change directory to "subfolder"
And we run "jrnl -n 1" And we run "jrnl -n 1"

View file

@ -40,10 +40,12 @@ Feature: Custom formats
Given we parse the output as JSON Given we parse the output as JSON
Then "entries" in the parsed output should have 3 elements Then "entries" in the parsed output should have 3 elements
And "tags" in the parsed output should be And "tags" in the parsed output should be
"""
@ipsum @ipsum
@tagone @tagone
@tagtwo @tagtwo
@tagthree @tagthree
"""
And "entries.0.tags" in the parsed output should have 3 elements And "entries.0.tags" in the parsed output should have 3 elements
And "entries.1.tags" in the parsed output should have 1 elements And "entries.1.tags" in the parsed output should have 1 elements
And "entries.2.tags" in the parsed output should have 2 elements And "entries.2.tags" in the parsed output should have 2 elements
@ -62,7 +64,9 @@ Feature: Custom formats
And the output should be valid JSON And the output should be valid JSON
Given we parse the output as JSON Given we parse the output as JSON
Then "entries.0.uuid" in the parsed output should be Then "entries.0.uuid" in the parsed output should be
"""
4BB1F46946AD439996C9B59DE7C4DDC1 4BB1F46946AD439996C9B59DE7C4DDC1
"""
Scenario Outline: Printing a journal that has multiline entries with tags Scenario Outline: Printing a journal that has multiline entries with tags
Given we use the config "<config_file>" Given we use the config "<config_file>"
@ -70,6 +74,7 @@ Feature: Custom formats
When we run "jrnl -n 1 @ipsum" When we run "jrnl -n 1 @ipsum"
Then we should get no error Then we should get no error
And the output should be And the output should be
"""
2020-08-29 11:11 Entry the first. 2020-08-29 11:11 Entry the first.
| Lorem @ipsum dolor sit amet, consectetur adipiscing elit. Praesent malesuada | Lorem @ipsum dolor sit amet, consectetur adipiscing elit. Praesent malesuada
| quis est ac dignissim. Aliquam dignissim rutrum pretium. Phasellus | quis est ac dignissim. Aliquam dignissim rutrum pretium. Phasellus
@ -90,6 +95,7 @@ Feature: Custom formats
| velit scelerisque fringilla. Phasellus pharetra justo et nulla fringilla, ac | velit scelerisque fringilla. Phasellus pharetra justo et nulla fringilla, ac
| porta sapien accumsan. Class aptent taciti sociosqu ad litora torquent per | porta sapien accumsan. Class aptent taciti sociosqu ad litora torquent per
| conubia nostra, per inceptos himenaeos. | conubia nostra, per inceptos himenaeos.
"""
Examples: configs Examples: configs
| config_file | | config_file |
@ -108,9 +114,11 @@ Feature: Custom formats
Given we parse the output as JSON Given we parse the output as JSON
Then "entries" in the parsed output should have 2 elements Then "entries" in the parsed output should have 2 elements
And "tags" in the parsed output should be And "tags" in the parsed output should be
"""
@ipsum @ipsum
@tagone @tagone
@tagtwo @tagtwo
"""
And "entries.0.tags" in the parsed output should have 3 elements And "entries.0.tags" in the parsed output should have 3 elements
And "entries.1.tags" in the parsed output should have 1 elements And "entries.1.tags" in the parsed output should have 1 elements
@ -125,6 +133,7 @@ Feature: Custom formats
Given we use the config "<config_file>" Given we use the config "<config_file>"
And we use the password "test" if prompted And we use the password "test" if prompted
Given we append to the editor if opened Given we append to the editor if opened
"""
[2021-10-14 13:23] Heading Test [2021-10-14 13:23] Heading Test
H1-1 H1-1
@ -167,10 +176,12 @@ Feature: Custom formats
More stuff More stuff
more stuff again more stuff again
"""
When we run "jrnl --edit -1" When we run "jrnl --edit -1"
Then the editor should have been called Then the editor should have been called
When we run "jrnl -1 --export markdown" When we run "jrnl -1 --export markdown"
Then the output should be Then the output should be
"""
# 2021 # 2021
## October ## October
@ -211,6 +222,7 @@ Feature: Custom formats
More stuff More stuff
more stuff again more stuff again
"""
Examples: configs Examples: configs
| config_file | | config_file |
@ -227,10 +239,12 @@ Feature: Custom formats
Then the output should be a valid XML string Then the output should be a valid XML string
And "entries" in the xml output should have 3 elements And "entries" in the xml output should have 3 elements
And "tags" in the xml output should contain And "tags" in the xml output should contain
"""
@ipsum @ipsum
@tagone @tagone
@tagtwo @tagtwo
@tagthree @tagthree
"""
And there should be 10 "tag" elements And there should be 10 "tag" elements
Examples: configs Examples: configs
@ -248,9 +262,11 @@ Feature: Custom formats
Given we parse the output as XML Given we parse the output as XML
Then "entries" in the parsed output should have 2 elements Then "entries" in the parsed output should have 2 elements
And "tags" in the parsed output should be And "tags" in the parsed output should be
"""
@idea @idea
@journal @journal
@dan @dan
"""
And there should be 7 "tag" elements And there should be 7 "tag" elements
Scenario Outline: Exporting tags Scenario Outline: Exporting tags
@ -258,10 +274,12 @@ Feature: Custom formats
And we use the password "test" if prompted And we use the password "test" if prompted
When we run "jrnl --export tags" When we run "jrnl --export tags"
Then the output should be Then the output should be
"""
@tagtwo : 2 @tagtwo : 2
@tagone : 2 @tagone : 2
@tagthree : 1 @tagthree : 1
@ipsum : 1 @ipsum : 1
"""
Examples: configs Examples: configs
| config_file | | config_file |
@ -293,6 +311,7 @@ Feature: Custom formats
And we use the password "test" if prompted And we use the password "test" if prompted
When we run "jrnl --export fancy" When we run "jrnl --export fancy"
Then the output should be Then the output should be
"""
2020-08-29 11:11 2020-08-29 11:11
Entry the first. Entry the first.
@ -375,6 +394,7 @@ Feature: Custom formats
Phasellus aliquam lacus placerat convallis vestibulum. Curabitur maximus at Phasellus aliquam lacus placerat convallis vestibulum. Curabitur maximus at
ante eget fringilla. @tagthree and also @tagone ante eget fringilla. @tagthree and also @tagone
"""
Examples: configs Examples: configs
| config_file | | config_file |
@ -390,11 +410,14 @@ Feature: Custom formats
And we create a cache directory And we create a cache directory
When we run "jrnl --format yaml --file {cache_dir}" When we run "jrnl --format yaml --file {cache_dir}"
Then the cache directory should contain the files Then the cache directory should contain the files
"""
2020-08-29_entry-the-first.md 2020-08-29_entry-the-first.md
2020-08-31_a-second-entry-in-what-i-hope-to-be-a-long-series.md 2020-08-31_a-second-entry-in-what-i-hope-to-be-a-long-series.md
2020-09-24_the-third-entry-finally-after-weeks-without-writing.md 2020-09-24_the-third-entry-finally-after-weeks-without-writing.md
"""
And the content of file "2020-08-29_entry-the-first.md" in the cache should be And the content of file "2020-08-29_entry-the-first.md" in the cache should be
"""
--- ---
title: Entry the first. title: Entry the first.
date: 2020-08-29 11:11 date: 2020-08-29 11:11
@ -420,6 +443,7 @@ Feature: Custom formats
porta sapien accumsan. Class aptent taciti sociosqu ad litora torquent per porta sapien accumsan. Class aptent taciti sociosqu ad litora torquent per
conubia nostra, per inceptos himenaeos. conubia nostra, per inceptos himenaeos.
... ...
"""
Examples: configs Examples: configs
| config_file | | config_file |
@ -451,10 +475,13 @@ Feature: Custom formats
And we create a cache directory And we create a cache directory
When we run "jrnl --export yaml -o {cache_dir}" When we run "jrnl --export yaml -o {cache_dir}"
Then the cache should contain the files Then the cache should contain the files
"""
2020-08-29_entry-the-first.md 2020-08-29_entry-the-first.md
2020-08-31_a-second-entry-in-what-i-hope-to-be-a-long-series.md 2020-08-31_a-second-entry-in-what-i-hope-to-be-a-long-series.md
2020-09-24_the-third-entry-finally-after-weeks-without-writing.md 2020-09-24_the-third-entry-finally-after-weeks-without-writing.md
"""
And the content of file "2020-09-24_the-third-entry-finally-after-weeks-without-writing.md" in the cache should be And the content of file "2020-09-24_the-third-entry-finally-after-weeks-without-writing.md" in the cache should be
"""
--- ---
title: The third entry finally after weeks without writing. title: The third entry finally after weeks without writing.
date: 2020-09-24 09:14 date: 2020-09-24 09:14
@ -472,6 +499,7 @@ Feature: Custom formats
Phasellus aliquam lacus placerat convallis vestibulum. Curabitur maximus at Phasellus aliquam lacus placerat convallis vestibulum. Curabitur maximus at
ante eget fringilla. @tagthree and also @tagone ante eget fringilla. @tagthree and also @tagone
... ...
"""
Examples: configs Examples: configs
| config_file | | config_file |
@ -516,6 +544,7 @@ Feature: Custom formats
Given we use the config "format_md.yaml" Given we use the config "format_md.yaml"
When we run "jrnl -n 1" When we run "jrnl -n 1"
Then the output should be Then the output should be
"""
# 2013 # 2013
## June ## June
@ -523,13 +552,16 @@ Feature: Custom formats
### 2013-06-10 15:40 Life is good. ### 2013-06-10 15:40 Life is good.
But I'm better. But I'm better.
"""
Scenario: Text Formatter from config file Scenario: Text Formatter from config file
Given we use the config "format_text.yaml" Given we use the config "format_text.yaml"
When we run "jrnl -n 1" When we run "jrnl -n 1"
Then the output should be Then the output should be
"""
[2013-06-10 15:40] Life is good. [2013-06-10 15:40] Life is good.
But I'm better. But I'm better.
"""
Scenario Outline: Exporting entries with Cyrillic characters to directory should not fail Scenario Outline: Exporting entries with Cyrillic characters to directory should not fail
Given we use the config "<config_file>" Given we use the config "<config_file>"
@ -538,7 +570,9 @@ Feature: Custom formats
When we run "jrnl 2020-11-21: Первая" When we run "jrnl 2020-11-21: Первая"
When we run "jrnl --format md --file {cache_dir} -on 2020-11-21" When we run "jrnl --format md --file {cache_dir} -on 2020-11-21"
Then the cache should contain the files Then the cache should contain the files
"""
2020-11-21_первая.md 2020-11-21_первая.md
"""
Examples: configs Examples: configs
| config_file | | config_file |
@ -553,9 +587,11 @@ Feature: Custom formats
When we run "jrnl 2020-08-31 01:01: Hi." When we run "jrnl 2020-08-31 01:01: Hi."
And we run "jrnl --format dates" And we run "jrnl --format dates"
Then the output should be Then the output should be
"""
2020-08-29, 1 2020-08-29, 1
2020-08-31, 2 2020-08-31, 2
2020-09-24, 1 2020-09-24, 1
"""
Examples: configs Examples: configs
| config_file | | config_file |
@ -602,30 +638,42 @@ Feature: Custom formats
Given we use the config "basic_onefile.yaml" Given we use the config "basic_onefile.yaml"
When we run "jrnl --list" When we run "jrnl --list"
Then the output should match Then the output should match
"""
Journals defined in config \(.+basic_onefile\.yaml\) Journals defined in config \(.+basic_onefile\.yaml\)
\* default -> features/journals/basic_onefile\.journal \* default -> features/journals/basic_onefile\.journal
"""
When we run "jrnl --list --format json" When we run "jrnl --list --format json"
Then the output should match Then the output should match
"""
{"config_path": ".+basic_onefile\.yaml", "journals": {"default": "features/journals/basic_onefile\.journal"}} {"config_path": ".+basic_onefile\.yaml", "journals": {"default": "features/journals/basic_onefile\.journal"}}
"""
When we run "jrnl --list --format yaml" When we run "jrnl --list --format yaml"
Then the output should match Then the output should match
"""
config_path: .+basic_onefile\.yaml config_path: .+basic_onefile\.yaml
journals: journals:
default: features/journals/basic_onefile\.journal default: features/journals/basic_onefile\.journal
"""
Scenario: Export journal list to formats with no default journal Scenario: Export journal list to formats with no default journal
Given we use the config "no_default_journal.yaml" Given we use the config "no_default_journal.yaml"
When we run "jrnl --list" When we run "jrnl --list"
Then the output should match Then the output should match
"""
Journals defined in config \(.+no_default_journal\.yaml\) Journals defined in config \(.+no_default_journal\.yaml\)
\* simple -> features/journals/simple\.journal \* simple -> features/journals/simple\.journal
\* work -> features/journals/work\.journal \* work -> features/journals/work\.journal
"""
When we run "jrnl --list --format json" When we run "jrnl --list --format json"
Then the output should match Then the output should match
"""
{"config_path": ".+no_default_journal\.yaml", "journals": {"simple": "features/journals/simple\.journal", "work": "features/journals/work\.journal"}} {"config_path": ".+no_default_journal\.yaml", "journals": {"simple": "features/journals/simple\.journal", "work": "features/journals/work\.journal"}}
"""
When we run "jrnl --list --format yaml" When we run "jrnl --list --format yaml"
Then the output should match Then the output should match
"""
config_path: .+no_default_journal\.yaml config_path: .+no_default_journal\.yaml
journals: journals:
simple: features/journals/simple\.journal simple: features/journals/simple\.journal
work: features/journals/work\.journal work: features/journals/work\.journal
"""

View file

@ -21,6 +21,7 @@ Feature: Importing data
Given we use the config "<config_file>" Given we use the config "<config_file>"
And we use the password "test" if prompted And we use the password "test" if prompted
When we run "jrnl --import" and pipe When we run "jrnl --import" and pipe
"""
[2020-07-05 15:00] Observe and import. [2020-07-05 15:00] Observe and import.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent malesuada quis Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent malesuada quis
est ac dignissim. Aliquam dignissim rutrum pretium. Phasellus pellentesque augue est ac dignissim. Aliquam dignissim rutrum pretium. Phasellus pellentesque augue
@ -28,6 +29,7 @@ Feature: Importing data
Aenean ante ex, elementum ut interdum et, mattis eget lacus. In commodo nulla nec Aenean ante ex, elementum ut interdum et, mattis eget lacus. In commodo nulla nec
tellus placerat, sed ultricies metus bibendum. Duis eget venenatis erat. In at tellus placerat, sed ultricies metus bibendum. Duis eget venenatis erat. In at
dolor dui end of entry. dolor dui end of entry.
"""
When we run "jrnl -on 2020-07-05" When we run "jrnl -on 2020-07-05"
Then the output should contain "2020-07-05 15:00 Observe and import." Then the output should contain "2020-07-05 15:00 Observe and import."
And the output should contain "Lorem ipsum" And the output should contain "Lorem ipsum"
@ -44,11 +46,13 @@ Feature: Importing data
Given we use the config "<config_file>" Given we use the config "<config_file>"
And we use the password "test" if prompted And we use the password "test" if prompted
When we run "jrnl --import" and pipe When we run "jrnl --import" and pipe
"""
[2020-07-05 15:00] Observe and import. [2020-07-05 15:00] Observe and import.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
[2020-07-05 15:01] Twice as nice. [2020-07-05 15:01] Twice as nice.
Sed dignissim sed nisl eu consequat. Sed dignissim sed nisl eu consequat.
"""
When we run "jrnl -on 2020-07-05" When we run "jrnl -on 2020-07-05"
Then the output should contain "2020-07-05 15:00 Observe and import." Then the output should contain "2020-07-05 15:00 Observe and import."
And the output should contain "Lorem ipsum" And the output should contain "Lorem ipsum"
@ -83,7 +87,9 @@ Feature: Importing data
But the output should not contain "I have an @idea" But the output should not contain "I have an @idea"
And the output should not contain "I met with" And the output should not contain "I met with"
When we run "jrnl --import --file features/journals/tags.journal" and pipe When we run "jrnl --import --file features/journals/tags.journal" and pipe
"""
[2020-07-05 15:00] I should not exist! [2020-07-05 15:00] I should not exist!
"""
And we run "jrnl -99" And we run "jrnl -99"
Then the output should contain "My first entry." Then the output should contain "My first entry."
And the output should contain "PROFIT!" And the output should contain "PROFIT!"

View file

@ -3,9 +3,11 @@ Feature: Installing jrnl
Scenario: Install jrnl with default options Scenario: Install jrnl with default options
Given we use no config Given we use no config
When we run "jrnl hello world" and enter When we run "jrnl hello world" and enter
"""
\n \n
\n \n
\n \n
"""
Then the output should contain "jrnl configuration created at" Then the output should contain "jrnl configuration created at"
And the output should contain "For advanced features, read the docs at https://jrnl.sh" And the output should contain "For advanced features, read the docs at https://jrnl.sh"
And the output should contain "Journal 'default' created" And the output should contain "Journal 'default' created"
@ -16,9 +18,11 @@ Feature: Installing jrnl
Scenario: Install jrnl with custom relative default journal path Scenario: Install jrnl with custom relative default journal path
Given we use no config Given we use no config
When we run "jrnl hello world" and enter When we run "jrnl hello world" and enter
"""
default/custom.txt default/custom.txt
n n
\n \n
"""
Then the output should contain "Journal 'default' created" Then the output should contain "Journal 'default' created"
And the default journal "custom.txt" should be in the "default" directory And the default journal "custom.txt" should be in the "default" directory
And the config should contain "encrypt: false" And the config should contain "encrypt: false"
@ -28,9 +32,11 @@ Feature: Installing jrnl
Given we use no config Given we use no config
And the home directory is called "home" And the home directory is called "home"
When we run "jrnl hello world" and enter When we run "jrnl hello world" and enter
"""
~/custom.txt ~/custom.txt
n n
\n \n
"""
Then the output should contain "Journal 'default' created" Then the output should contain "Journal 'default' created"
And the default journal "custom.txt" should be in the "home" directory And the default journal "custom.txt" should be in the "home" directory
And the config should contain "encrypt: false" And the config should contain "encrypt: false"
@ -39,9 +45,11 @@ Feature: Installing jrnl
Scenario: Install jrnl with encrypted default journal Scenario: Install jrnl with encrypted default journal
Given we use no config Given we use no config
When we run "jrnl hello world" and enter When we run "jrnl hello world" and enter
"""
encrypted.txt encrypted.txt
y y
\n \n
"""
Then the output should contain "Journal will be encrypted" Then the output should contain "Journal will be encrypted"
And the default journal "encrypted.txt" should be in the "." directory And the default journal "encrypted.txt" should be in the "." directory
And the config should contain "encrypt: true" And the config should contain "encrypt: true"
@ -52,46 +60,58 @@ Feature: Installing jrnl
Scenario: Install jrnl with colors by default Scenario: Install jrnl with colors by default
Given we use no config Given we use no config
When we run "jrnl hello world" and enter When we run "jrnl hello world" and enter
"""
\n \n
\n \n
\n \n
"""
Then the output should contain "Journal 'default' created" Then the output should contain "Journal 'default' created"
And the config should contain And the config should contain
"""
colors: colors:
body: none body: none
date: black date: black
tags: yellow tags: yellow
title: cyan title: cyan
"""
Scenario: Install jrnl without colors Scenario: Install jrnl without colors
Given we use no config Given we use no config
When we run "jrnl hello world" and enter When we run "jrnl hello world" and enter
"""
\n \n
\n \n
N N
"""
Then the output should contain "Journal 'default' created" Then the output should contain "Journal 'default' created"
And the config should contain And the config should contain
"""
colors: colors:
body: none body: none
date: none date: none
tags: none tags: none
title: none title: none
"""
Scenario: Install jrnl with encrypted default journal with no entries Scenario: Install jrnl with encrypted default journal with no entries
Given we use no config Given we use no config
When we run "jrnl -1" and enter When we run "jrnl -1" and enter
"""
encrypted.txt encrypted.txt
y y
n n
test test
test test
n n
"""
Then the error output should contain "Journal will be encrypted" Then the error output should contain "Journal will be encrypted"
And the default journal "encrypted.txt" should be in the "." directory And the default journal "encrypted.txt" should be in the "." directory
And the config should contain "encrypt: true" And the config should contain "encrypt: true"
And the version in the config file should be up-to-date And the version in the config file should be up-to-date
When we run "jrnl -1" and enter When we run "jrnl -1" and enter
"""
test test
"""
Then we should be prompted for a password Then we should be prompted for a password
And the error output should contain "no entries found" And the error output should contain "no entries found"
And the error output should not contain "Wrong password, try again" And the error output should not contain "Wrong password, try again"

View file

@ -7,8 +7,10 @@ Feature: Multiple journals
Given we use the config "multiple.yaml" Given we use the config "multiple.yaml"
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
"""
2013-06-09 15:39 My first entry. 2013-06-09 15:39 My first entry.
2013-06-10 15:40 Life is good. 2013-06-10 15:40 Life is good.
"""
When we run "jrnl work -99 --short" When we run "jrnl work -99 --short"
Then the output should be empty Then the output should be empty
@ -17,10 +19,14 @@ Feature: Multiple journals
When we run "jrnl this goes to default" When we run "jrnl this goes to default"
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should contain Then the output should contain
"""
2013-06-09 15:39 My first entry. 2013-06-09 15:39 My first entry.
2013-06-10 15:40 Life is good. 2013-06-10 15:40 Life is good.
"""
Then the output should contain Then the output should contain
"""
this goes to default this goes to default
"""
When we run "jrnl work -99 --short" When we run "jrnl work -99 --short"
Then the output should be empty Then the output should be empty
@ -29,8 +35,10 @@ Feature: Multiple journals
When we run "jrnl work a long day in the office" When we run "jrnl work a long day in the office"
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
"""
2013-06-09 15:39 My first entry. 2013-06-09 15:39 My first entry.
2013-06-10 15:40 Life is good. 2013-06-10 15:40 Life is good.
"""
When we run "jrnl work -99 --short" When we run "jrnl work -99 --short"
Then the output should contain "a long day in the office" Then the output should contain "a long day in the office"
@ -44,32 +52,44 @@ Feature: Multiple journals
When we run "jrnl work 23 july 2012: a long day in the office" When we run "jrnl work 23 july 2012: a long day in the office"
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
"""
2013-06-09 15:39 My first entry. 2013-06-09 15:39 My first entry.
2013-06-10 15:40 Life is good. 2013-06-10 15:40 Life is good.
"""
When we run "jrnl work -99 --short" When we run "jrnl work -99 --short"
Then the output should be Then the output should be
"""
2012-07-23 09:00 a long day in the office 2012-07-23 09:00 a long day in the office
"""
Scenario: Write to specified journal without a timestamp but with colon Scenario: Write to specified journal without a timestamp but with colon
Given we use the config "multiple.yaml" Given we use the config "multiple.yaml"
When we run "jrnl work : a long day in the office" When we run "jrnl work : a long day in the office"
Then the output should be Then the output should be
"""
2013-06-09 15:39 My first entry. 2013-06-09 15:39 My first entry.
2013-06-10 15:40 Life is good. 2013-06-10 15:40 Life is good.
"""
When we run "jrnl work -99 --short" When we run "jrnl work -99 --short"
Then the output should be contain Then the output should be contain
"""
a long day in the office a long day in the office
"""
Scenario: Write to specified journal without a timestamp but with colon Scenario: Write to specified journal without a timestamp but with colon
Given we use the config "multiple.yaml" Given we use the config "multiple.yaml"
When we run "jrnl work: a long day in the office" When we run "jrnl work: a long day in the office"
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
"""
2013-06-09 15:39 My first entry. 2013-06-09 15:39 My first entry.
2013-06-10 15:40 Life is good. 2013-06-10 15:40 Life is good.
"""
When we run "jrnl work -99 --short" When we run "jrnl work -99 --short"
Then the output should contain Then the output should contain
"""
a long day in the office a long day in the office
"""
Scenario: Create new journals as required Scenario: Create new journals as required
Given we use the config "multiple.yaml" Given we use the config "multiple.yaml"
@ -77,7 +97,9 @@ Feature: Multiple journals
When we run "jrnl ideas 23 july 2012: sell my junk on ebay and make lots of money" When we run "jrnl ideas 23 july 2012: sell my junk on ebay and make lots of money"
When we run "jrnl ideas -99 --short" When we run "jrnl ideas -99 --short"
Then the output should be Then the output should be
"""
2012-07-23 09:00 sell my junk on ebay and make lots of money 2012-07-23 09:00 sell my junk on ebay and make lots of money
"""
Scenario: Don't crash if no default journal is specified Scenario: Don't crash if no default journal is specified
Given we use the config "no_default_journal.yaml" Given we use the config "no_default_journal.yaml"
@ -87,9 +109,11 @@ Feature: Multiple journals
Scenario: Don't crash if no file exists for a configured encrypted journal Scenario: Don't crash if no file exists for a configured encrypted journal
Given we use the config "multiple.yaml" Given we use the config "multiple.yaml"
When we run "jrnl new_encrypted Adding first entry" and enter When we run "jrnl new_encrypted Adding first entry" and enter
"""
these three eyes these three eyes
these three eyes these three eyes
n n
"""
Then the output should contain "Journal 'new_encrypted' created at" Then the output should contain "Journal 'new_encrypted' created at"
Scenario: Read and write to journal with emoji name Scenario: Read and write to journal with emoji name

View file

@ -7,7 +7,9 @@ Feature: Implementing Runtime Overrides for Select Configuration Keys
Given we use the config "basic_encrypted.yaml" Given we use the config "basic_encrypted.yaml"
And we use the password "test" if prompted And we use the password "test" if prompted
When we run "jrnl --config-override editor ''" and type When we run "jrnl --config-override editor ''" and type
"""
This is a journal entry This is a journal entry
"""
Then the stdin prompt should have been called Then the stdin prompt should have been called
And the editor should not have been called And the editor should not have been called
When we run "jrnl -1" When we run "jrnl -1"
@ -27,6 +29,7 @@ Feature: Implementing Runtime Overrides for Select Configuration Keys
And we use the password "test" if prompted And we use the password "test" if prompted
When we run "jrnl -2 --config-override linewrap 23 --format fancy" When we run "jrnl -2 --config-override linewrap 23 --format fancy"
Then the output should be Then the output should be
"""
2013-06-09 15:39 2013-06-09 15:39
My My
fir st ent ry. fir st ent ry.
@ -40,6 +43,7 @@ Feature: Implementing Runtime Overrides for Select Configuration Keys
But I'm better. But I'm better.
"""
Scenario: Override color selections with runtime overrides Scenario: Override color selections with runtime overrides
@ -59,12 +63,14 @@ Feature: Implementing Runtime Overrides for Select Configuration Keys
And we use the password "test" if prompted And we use the password "test" if prompted
When we run "jrnl -1 --config-override colors.body green --config-override editor 'nano'" When we run "jrnl -1 --config-override colors.body green --config-override editor 'nano'"
Then the config in memory should contain Then the config in memory should contain
"""
editor: nano editor: nano
colors: colors:
title: none title: none
body: green body: green
tags: none tags: none
date: none date: none
"""
Scenario: Override default journal Scenario: Override default journal
@ -74,6 +80,7 @@ Feature: Implementing Runtime Overrides for Select Configuration Keys
Then we should get no error Then we should get no error
When we run "jrnl -3 --config-override journals.default features/journals/simple.journal" When we run "jrnl -3 --config-override journals.default features/journals/simple.journal"
Then the output should be Then the output should be
"""
2000-03-20 09:00 The rain in Spain comes from clouds 2000-03-20 09:00 The rain in Spain comes from clouds
2013-06-09 15:39 My first entry. 2013-06-09 15:39 My first entry.
@ -81,6 +88,7 @@ Feature: Implementing Runtime Overrides for Select Configuration Keys
2013-06-10 15:40 Life is good. 2013-06-10 15:40 Life is good.
| But I'm better. | But I'm better.
"""
Scenario: Make an entry into an overridden journal Scenario: Make an entry into an overridden journal
@ -91,6 +99,7 @@ Feature: Implementing Runtime Overrides for Select Configuration Keys
And the output should contain "Entry added" And the output should contain "Entry added"
When we run "jrnl --config-override journals.temp features/journals/simple.journal temp -3" When we run "jrnl --config-override journals.temp features/journals/simple.journal temp -3"
Then the output should be Then the output should be
"""
1969-09-06 09:00 @say Ni 1969-09-06 09:00 @say Ni
2013-06-09 15:39 My first entry. 2013-06-09 15:39 My first entry.
@ -98,3 +107,4 @@ Feature: Implementing Runtime Overrides for Select Configuration Keys
2013-06-10 15:40 Life is good. 2013-06-10 15:40 Life is good.
| But I'm better. | But I'm better.
"""

View file

@ -7,9 +7,11 @@ Feature: Using the installed keyring
Given we use the config "multiple.yaml" Given we use the config "multiple.yaml"
And we have a keyring And we have a keyring
When we run "jrnl simple --encrypt" and enter When we run "jrnl simple --encrypt" and enter
"""
sabertooth sabertooth
sabertooth sabertooth
Y Y
"""
Then the config for journal "simple" should contain "encrypt: true" Then the config for journal "simple" should contain "encrypt: true"
When we run "jrnl simple -n 1" When we run "jrnl simple -n 1"
Then the output should contain "2013-06-10 15:40 Life is good" Then the output should contain "2013-06-10 15:40 Life is good"
@ -19,9 +21,11 @@ Feature: Using the installed keyring
Given we use the config "simple.yaml" Given we use the config "simple.yaml"
When we run "jrnl test entry" When we run "jrnl test entry"
And we run "jrnl --encrypt" and enter And we run "jrnl --encrypt" and enter
"""
password password
password password
n n
"""
Then we should get no error Then we should get no error
And the output should not contain "Failed to retrieve keyring" And the output should not contain "Failed to retrieve keyring"
@ -30,9 +34,11 @@ Feature: Using the installed keyring
Given we use the config "simple.yaml" Given we use the config "simple.yaml"
When we run "jrnl test entry" When we run "jrnl test entry"
And we run "jrnl --encrypt" and enter And we run "jrnl --encrypt" and enter
"""
password password
password password
y y
"""
Then we should get no error Then we should get no error
And the output should not contain "Failed to retrieve keyring" And the output should not contain "Failed to retrieve keyring"
# @todo add step to check contents of keyring # @todo add step to check contents of keyring
@ -55,9 +61,11 @@ Feature: Using the installed keyring
Given we use the config "simple.yaml" Given we use the config "simple.yaml"
And we have a failed keyring And we have a failed keyring
When we run "jrnl --encrypt" and enter When we run "jrnl --encrypt" and enter
"""
this password will not be saved in keyring this password will not be saved in keyring
this password will not be saved in keyring this password will not be saved in keyring
y y
"""
Then the output should contain "Failed to retrieve keyring" Then the output should contain "Failed to retrieve keyring"
And we should get no error And we should get no error
And we should be prompted for a password And we should be prompted for a password
@ -77,8 +85,10 @@ Feature: Using the installed keyring
When we run "jrnl --short" When we run "jrnl --short"
Then we should not be prompted for a password Then we should not be prompted for a password
And the output should be And the output should be
"""
2013-06-09 15:39 My first entry. 2013-06-09 15:39 My first entry.
2013-06-10 15:40 Life is good. 2013-06-10 15:40 Life is good.
"""
Scenario: Open encrypted journal when keyring exists but fails Scenario: Open encrypted journal when keyring exists but fails
@ -96,25 +106,31 @@ Feature: Using the installed keyring
Scenario: Mistyping your password Scenario: Mistyping your password
Given we use the config "simple.yaml" Given we use the config "simple.yaml"
When we run "jrnl --encrypt" and enter When we run "jrnl --encrypt" and enter
"""
swordfish swordfish
sordfish sordfish
"""
Then we should be prompted for a password Then we should be prompted for a password
And the output should contain "Passwords did not match" And the output should contain "Passwords did not match"
And the config for journal "default" should not contain "encrypt: true" And the config for journal "default" should not contain "encrypt: true"
When we run "jrnl --short" When we run "jrnl --short"
Then the output should be Then the output should be
"""
2013-06-09 15:39 My first entry. 2013-06-09 15:39 My first entry.
2013-06-10 15:40 Life is good. 2013-06-10 15:40 Life is good.
"""
Scenario: Mistyping your password, then getting it right Scenario: Mistyping your password, then getting it right
Given we use the config "simple.yaml" Given we use the config "simple.yaml"
When we run "jrnl --encrypt" and enter When we run "jrnl --encrypt" and enter
"""
swordfish swordfish
sordfish sordfish
swordfish swordfish
swordfish swordfish
n n
"""
Then we should be prompted for a password Then we should be prompted for a password
And the output should contain "Passwords did not match" And the output should contain "Passwords did not match"
And the output should contain "Journal encrypted" And the output should contain "Journal encrypted"

View file

@ -65,7 +65,9 @@ Feature: Searching in a journal
Then we should get no error Then we should get no error
And the output should contain "1 entry found" And the output should contain "1 entry found"
And the output should be And the output should be
"""
2020-08-29 11:11 Entry the first. 2020-08-29 11:11 Entry the first.
"""
Examples: configs Examples: configs
| config_file | | config_file |
@ -92,9 +94,11 @@ Feature: Searching in a journal
Then we should get no error Then we should get no error
And the output should contain "3 entries found" And the output should contain "3 entries found"
And the output should be And the output should be
"""
2020-08-29 11:11 Entry the first. 2020-08-29 11:11 Entry the first.
2020-08-31 14:32 A second entry in what I hope to be a long series. 2020-08-31 14:32 A second entry in what I hope to be a long series.
2020-09-24 09:14 The third entry finally after weeks without writing. 2020-09-24 09:14 The third entry finally after weeks without writing.
"""
Examples: configs Examples: configs
| config_file | | config_file |
@ -108,7 +112,9 @@ Feature: Searching in a journal
Then we should get no error Then we should get no error
And the output should contain "1 entry found" And the output should contain "1 entry found"
And the output should be And the output should be
"""
2020-09-24 09:14 The third entry finally after weeks without writing. 2020-09-24 09:14 The third entry finally after weeks without writing.
"""
Examples: configs Examples: configs
| config_file | | config_file |
@ -219,19 +225,23 @@ Feature: Searching in a journal
Then we should get no error Then we should get no error
When we run "jrnl -2" When we run "jrnl -2"
Then the output should be Then the output should be
"""
2013-07-23 09:00 Testing folder journal. 2013-07-23 09:00 Testing folder journal.
2014-03-07 16:37 Second entry of journal. 2014-03-07 16:37 Second entry of journal.
"""
Scenario Outline: Searching for all tags should show counts of each tag Scenario Outline: Searching for all tags should show counts of each tag
Given we use the config "<config_file>" Given we use the config "<config_file>"
When we run "jrnl --tags" When we run "jrnl --tags"
Then we should get no error Then we should get no error
And the output should be And the output should be
"""
@tagtwo : 2 @tagtwo : 2
@tagone : 2 @tagone : 2
@tagthree : 1 @tagthree : 1
@ipsum : 1 @ipsum : 1
"""
Examples: configs Examples: configs
| config_file | | config_file |
@ -244,8 +254,10 @@ Feature: Searching in a journal
When we run "jrnl -from 'september 2020' --tags" When we run "jrnl -from 'september 2020' --tags"
Then we should get no error Then we should get no error
And the output should be And the output should be
"""
@tagthree : 1 @tagthree : 1
@tagone : 1 @tagone : 1
"""
Examples: configs Examples: configs
| config_file | | config_file |
@ -257,8 +269,10 @@ Feature: Searching in a journal
Given we use the config "<config_file>" Given we use the config "<config_file>"
When we run "jrnl --tags -not @tagtwo" When we run "jrnl --tags -not @tagtwo"
Then the output should be Then the output should be
"""
@tagthree : 1 @tagthree : 1
@tagone : 1 @tagone : 1
"""
Examples: configs Examples: configs
| config_file | | config_file |
@ -270,7 +284,9 @@ Feature: Searching in a journal
Given we use the config "<config_file>" Given we use the config "<config_file>"
When we run "jrnl --tags -not @tagone -not @tagthree" When we run "jrnl --tags -not @tagone -not @tagthree"
Then the output should be Then the output should be
"""
@tagtwo : 1 @tagtwo : 1
"""
Examples: configs Examples: configs
| config_file | | config_file |
@ -302,11 +318,13 @@ Feature: Searching in a journal
When we run "jrnl -2" When we run "jrnl -2"
Then we should get no error Then we should get no error
And the output should be And the output should be
"""
2013-06-09 15:39 My first entry. 2013-06-09 15:39 My first entry.
| Everything is alright | Everything is alright
2013-06-10 15:40 Life is good. 2013-06-10 15:40 Life is good.
| But I'm better. | But I'm better.
"""
Scenario Outline: Searching by month Scenario Outline: Searching by month
Given we use the config "<config_file>" Given we use the config "<config_file>"
@ -381,8 +399,10 @@ Feature: Searching in a journal
And we run "jrnl -today-in-history --short" And we run "jrnl -today-in-history --short"
Then the output should contain "2 entries found" Then the output should contain "2 entries found"
And the output should be And the output should be
"""
2019-08-31 01:01 Hi, from last year. 2019-08-31 01:01 Hi, from last year.
2020-08-31 14:32 A second entry in what I hope to be a long series. 2020-08-31 14:32 A second entry in what I hope to be a long series.
"""
Examples: configs Examples: configs
| config_file | | config_file |
@ -397,11 +417,13 @@ Feature: Searching in a journal
Then we should get no error Then we should get no error
And the output should contain "3 entries found" And the output should contain "3 entries found"
And the output should be And the output should be
"""
2013-05-17 11:39 This entry has tags! 2013-05-17 11:39 This entry has tags!
2013-06-17 20:38 This entry has a location. 2013-06-17 20:38 This entry has a location.
2013-07-17 11:38 This entry is starred! 2013-07-17 11:38 This entry is starred!
"""
Scenario Outline: Searching the most recent entry should not show found count Scenario Outline: Searching the most recent entry should not show found count
Given we use the config "<config_file>" Given we use the config "<config_file>"

View file

@ -11,9 +11,11 @@ Feature: Tagging
When we run "jrnl --tags -on 2020-09-26" When we run "jrnl --tags -on 2020-09-26"
Then we should get no error Then we should get no error
And the output should be And the output should be
"""
@os/2 : 1 @os/2 : 1
@c++ : 1 @c++ : 1
@c# : 1 @c# : 1
"""
Examples: configs Examples: configs
| config_file | | config_file |
@ -41,8 +43,10 @@ Feature: Tagging
When we run "jrnl 2020-09-26: @foo came over, we went to a @bar" When we run "jrnl 2020-09-26: @foo came over, we went to a @bar"
When we run "jrnl --tags -on 2020-09-26" When we run "jrnl --tags -on 2020-09-26"
Then the output should be Then the output should be
"""
@foo : 1 @foo : 1
@bar : 1 @bar : 1
"""
Examples: configs Examples: configs
| config_file | | config_file |

View file

@ -2,12 +2,13 @@
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
Feature: Using templates Feature: Using templates
Scenario Outline: Template contents should be used in new entry Scenario Outline: Template contents should be used in new entry
Given we use the config "<config_file>" Given we use the config "<config_file>"
And we use the password "test" if prompted And we use the password "test" if prompted
And we append to the editor if opened And we append to the editor if opened
"""
This is an addition to a templated entry This is an addition to a templated entry
"""
When we run "jrnl --config-override template features/templates/basic.template" When we run "jrnl --config-override template features/templates/basic.template"
And we run "jrnl -1" And we run "jrnl -1"
Then the output should contain "This text is in the basic template" Then the output should contain "This text is in the basic template"

View file

@ -8,19 +8,27 @@ Feature: Upgrading Journals from 1.x.x to 2.x.x
When we run "jrnl -9" and enter "Y" When we run "jrnl -9" and enter "Y"
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
"""
2010-06-10 15:00 A life without chocolate is like a bad analogy. 2010-06-10 15:00 A life without chocolate is like a bad analogy.
2013-06-10 15:40 He said "[this] is the best time to be alive".Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent malesuada 2013-06-10 15:40 He said "[this] is the best time to be alive".Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent malesuada
"""
And the output should contain And the output should contain
"""
2010-06-10 15:00 A life without chocolate is like a bad analogy. 2010-06-10 15:00 A life without chocolate is like a bad analogy.
"""
And the output should contain And the output should contain
"""
2013-06-10 15:40 He said "[this] is the best time to be alive". 2013-06-10 15:40 He said "[this] is the best time to be alive".
"""
Scenario: Upgrading a journal encrypted with jrnl 1.x Scenario: Upgrading a journal encrypted with jrnl 1.x
Given we use the config "encrypted_old.json" Given we use the config "encrypted_old.json"
When we run "jrnl -n 1" and enter When we run "jrnl -n 1" and enter
"""
Y Y
bad doggie no biscuit bad doggie no biscuit
bad doggie no biscuit bad doggie no biscuit
"""
Then we should be prompted for a password Then we should be prompted for a password
And the output should contain "2013-06-10 15:40 Life is good" And the output should contain "2013-06-10 15:40 Life is good"
@ -28,18 +36,22 @@ Feature: Upgrading Journals from 1.x.x to 2.x.x
Given we use the config "no_colors.yaml" Given we use the config "no_colors.yaml"
When we run "jrnl -n 1" When we run "jrnl -n 1"
Then the config should contain Then the config should contain
"""
colors: colors:
date: none date: none
title: none title: none
body: none body: none
tags: none tags: none
"""
Scenario: Upgrade and parse journals with little endian date format Scenario: Upgrade and parse journals with little endian date format
Given we use the config "upgrade_from_195_little_endian_dates.json" Given we use the config "upgrade_from_195_little_endian_dates.json"
When we run "jrnl -9 --short" and enter "Y" When we run "jrnl -9 --short" and enter "Y"
Then the output should contain Then the output should contain
"""
10.06.2010 15:00 A life without chocolate is like a bad analogy. 10.06.2010 15:00 A life without chocolate is like a bad analogy.
10.06.2013 15:40 He said "[this] is the best time to be alive". 10.06.2013 15:40 He said "[this] is the best time to be alive".
"""
Scenario: Upgrade with missing journal Scenario: Upgrade with missing journal
Given we use the config "upgrade_from_195_with_missing_journal.json" Given we use the config "upgrade_from_195_with_missing_journal.json"
@ -50,8 +62,10 @@ Feature: Upgrading Journals from 1.x.x to 2.x.x
Scenario: Upgrade with missing encrypted journal Scenario: Upgrade with missing encrypted journal
Given we use the config "upgrade_from_195_with_missing_encrypted_journal.json" Given we use the config "upgrade_from_195_with_missing_encrypted_journal.json"
When we run "jrnl --list" and enter When we run "jrnl --list" and enter
"""
Y Y
bad doggie no biscuit bad doggie no biscuit
"""
Then the output should contain "features/journals/missing.journal does not exist" Then the output should contain "features/journals/missing.journal does not exist"
And the output should contain "We're all done" And the output should contain "We're all done"
And we should get no error And we should get no error

View file

@ -67,7 +67,9 @@ Feature: Writing new entries.
Then we should get no error Then we should get no error
Then the editor should have been called Then the editor should have been called
And the editor file content should be And the editor file content should be
"""
this is a partial this is a partial
"""
Examples: configs Examples: configs
| config_file | | config_file |
@ -146,8 +148,10 @@ Feature: Writing new entries.
Then we should get no error Then we should get no error
When we run "jrnl -1" When we run "jrnl -1"
Then the output should be Then the output should be
"""
2014-04-24 09:00 Created a new website - empty.com. 2014-04-24 09:00 Created a new website - empty.com.
| Hope to get a lot of traffic. | Hope to get a lot of traffic.
"""
Examples: configs Examples: configs
| config_file | | config_file |
@ -206,13 +210,17 @@ Feature: Writing new entries.
Given we parse the output as JSON Given we parse the output as JSON
Then "entries" in the parsed output should have 5 elements Then "entries" in the parsed output should have 5 elements
And "entries.0.creator" in the parsed output should be And "entries.0.creator" in the parsed output should be
"""
software_agent software_agent
os_agent os_agent
host_name host_name
generation_date generation_date
device_agent device_agent
"""
And "entries.0.creator.software_agent" in the parsed output should contain And "entries.0.creator.software_agent" in the parsed output should contain
"""
jrnl jrnl
"""
Scenario: Title with an embedded period on DayOne journal Scenario: Title with an embedded period on DayOne journal
Given we use the config "dayone.yaml" Given we use the config "dayone.yaml"
@ -220,8 +228,10 @@ Feature: Writing new entries.
Then we should get no error Then we should get no error
When we run "jrnl -1" When we run "jrnl -1"
Then the output should be Then the output should be
"""
2014-04-24 09:00 Ran 6.2 miles today in 1:02:03. 2014-04-24 09:00 Ran 6.2 miles today in 1:02:03.
| I am feeling sore because I forgot to stretch. | I am feeling sore because I forgot to stretch.
"""
Scenario: Opening an folder that's not a DayOne folder should treat as folder journal Scenario: Opening an folder that's not a DayOne folder should treat as folder journal
Given we use the config "empty_folder.yaml" Given we use the config "empty_folder.yaml"
@ -234,7 +244,9 @@ Feature: Writing new entries.
Given we use the config "<config_file>" Given we use the config "<config_file>"
And we use the password "test" if prompted And we use the password "test" if prompted
And we append to the editor if opened And we append to the editor if opened
"""
[2021-11-13] worked on jrnl tests [2021-11-13] worked on jrnl tests
"""
When we run "jrnl --edit" When we run "jrnl --edit"
Then the error output should contain "3 entries found" Then the error output should contain "3 entries found"
And the error output should contain "1 entry added" And the error output should contain "1 entry added"
@ -252,9 +264,11 @@ Feature: Writing new entries.
Given we use the config "<config_file>" Given we use the config "<config_file>"
And we use the password "test" if prompted And we use the password "test" if prompted
And we append to the editor if opened And we append to the editor if opened
"""
[2021-11-11] worked on jrnl tests [2021-11-11] worked on jrnl tests
[2021-11-12] worked on jrnl tests again [2021-11-12] worked on jrnl tests again
[2021-11-13] worked on jrnl tests a little bit more [2021-11-13] worked on jrnl tests a little bit more
"""
When we run "jrnl --edit" When we run "jrnl --edit"
Then the error output should contain "3 entries found" Then the error output should contain "3 entries found"
And the error output should contain "3 entries added" And the error output should contain "3 entries added"
@ -271,7 +285,9 @@ Feature: Writing new entries.
Given we use the config "<config_file>" Given we use the config "<config_file>"
And we use the password "test" if prompted And we use the password "test" if prompted
And we write to the editor if opened And we write to the editor if opened
"""
[2021-11-13] I am replacing my whole journal with this entry [2021-11-13] I am replacing my whole journal with this entry
"""
When we run "jrnl --edit" When we run "jrnl --edit"
Then the output should contain "2 entries deleted" Then the output should contain "2 entries deleted"
And the output should contain "1 entry modified" And the output should contain "1 entry modified"
@ -288,7 +304,9 @@ Feature: Writing new entries.
Given we use the config "<config_file>" Given we use the config "<config_file>"
And we use the password "test" if prompted And we use the password "test" if prompted
And we write to the editor if opened And we write to the editor if opened
"""
[2021-11-13] I am replacing the last entry with this entry [2021-11-13] I am replacing the last entry with this entry
"""
When we run "jrnl --edit -1" When we run "jrnl --edit -1"
Then the error output should contain "1 entry modified" Then the error output should contain "1 entry modified"
@ -304,7 +322,9 @@ Feature: Writing new entries.
Given we use the config "<config_file>" Given we use the config "<config_file>"
And we use the password "test" if prompted And we use the password "test" if prompted
And we append to the editor if opened And we append to the editor if opened
"""
This is a small addendum to my latest entry. This is a small addendum to my latest entry.
"""
When we run "jrnl --edit" When we run "jrnl --edit"
Then the error output should contain "3 entries found" Then the error output should contain "3 entries found"
And the error output should contain "1 entry modified" And the error output should contain "1 entry modified"
@ -341,12 +361,16 @@ Feature: Writing new entries.
Given we use the config "<config_file>" Given we use the config "<config_file>"
And we use the password "test" if prompted And we use the password "test" if prompted
And we append to the editor if opened And we append to the editor if opened
"""
@newtag @newtag
"""
When we run "jrnl --edit -1" When we run "jrnl --edit -1"
Then the error output should contain "1 entry modified" Then the error output should contain "1 entry modified"
When we run "jrnl --tags @newtag" When we run "jrnl --tags @newtag"
Then the output should contain Then the output should contain
"""
1 entry found 1 entry found
"""
Examples: configs Examples: configs
| config_file | | config_file |