standardize whitespace in behave tests, take out duplicate test

This commit is contained in:
Jonathan Wren 2020-09-27 12:26:52 -07:00
parent 8483d36208
commit 9116b63d8a
No known key found for this signature in database
GPG key ID: 43D5FF8722E7F68A
13 changed files with 327 additions and 339 deletions

View file

@ -19,13 +19,13 @@ Feature: Reading and writing to journal with custom date formats
When we run "jrnl -n 2"
Then we should get no error
And the output should be
"""
09.06.2013 15:39 My first entry.
| Everything is alright
"""
09.06.2013 15:39 My first entry.
| Everything is alright
10.07.2013 15:40 Life is good.
| But I'm better.
"""
10.07.2013 15:40 Life is good.
| But I'm better.
"""
Scenario Outline: Writing an entry from command line with custom date
Given we use the config "<config>.yaml"
@ -150,6 +150,6 @@ Feature: Reading and writing to journal with custom date formats
When we run "jrnl -1"
Then we should get no error
And the output should be
"""
2013-10-27 03:27 Some text.
"""
"""
2013-10-27 03:27 Some text.
"""

View file

@ -5,40 +5,40 @@ Feature: Delete entries from journal
When we run "jrnl -1"
Then the output should contain "2020-09-24 09:14 The third entry finally"
When we run "jrnl --delete" and enter
"""
N
N
Y
"""
"""
N
N
Y
"""
Then we flush the output
When we run "jrnl -99 --short"
Then the output should be
"""
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-29 11:11 Entry the first.
2020-08-31 14:32 A second entry in what I hope to be a long series.
"""
Examples: Configs
| config |
| basic_onefile |
| config |
| basic_onefile |
| basic_encrypted |
# | basic_folder | @todo
# | basic_dayone | @todo
# | basic_folder | @todo
# | basic_dayone | @todo
Scenario Outline: Backing out of interactive delete does not change journal
Given we use the config "<config>.yaml"
When we run "jrnl --delete -n 1" and enter
"""
N
"""
"""
N
"""
Then we flush the output
When we run "jrnl -99 --short"
Then the output should be
"""
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-09-24 09:14 The third entry finally after weeks without writing.
"""
"""
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-09-24 09:14 The third entry finally after weeks without writing.
"""
Examples: Configs
| config |
@ -53,11 +53,11 @@ Feature: Delete entries from journal
Then we flush the output
When we run "jrnl -99 --short"
Then the output should be
"""
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-09-24 09:14 The third entry finally after weeks without writing.
"""
"""
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-09-24 09:14 The third entry finally after weeks without writing.
"""
Examples: Configs
| config |
@ -68,16 +68,16 @@ Feature: Delete entries from journal
Scenario Outline: Delete flag with tag only deletes tagged entries
Given we use the config "<config>.yaml"
When we run "jrnl --delete @ipsum" and enter
"""
Y
"""
"""
Y
"""
Then we flush the output
When we run "jrnl -99 --short"
Then the output should be
"""
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-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.
"""
Examples: Configs
| config |
@ -89,16 +89,16 @@ Feature: Delete entries from journal
Scenario Outline: Delete flag with multiple tags deletes all entries matching any of the tags
Given we use the config "<config>.yaml"
When we run "jrnl --delete @ipsum @tagthree" and enter
"""
Y
Y
"""
"""
Y
Y
"""
Then we flush the output
When we run "jrnl -99 --short"
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
| config |
@ -109,16 +109,16 @@ Feature: Delete entries from journal
Scenario Outline: Delete flag with -and deletes boolean AND of tagged entries
Given we use the config "<config>.yaml"
When we run "jrnl --delete -and @tagone @tagtwo" and enter
"""
Y
"""
"""
Y
"""
Then we flush the output
When we run "jrnl -99 --short"
Then the output should be
"""
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-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.
"""
Examples: Configs
| config |
@ -129,16 +129,16 @@ Feature: Delete entries from journal
Scenario Outline: Delete flag with -not does not delete entries from given tag
Given we use the config "<config>.yaml"
When we run "jrnl --delete @tagone -not @ipsum" and enter
"""
Y
"""
"""
Y
"""
Then we flush the output
When we run "jrnl -99 --short"
Then the output should be
"""
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-29 11:11 Entry the first.
2020-08-31 14:32 A second entry in what I hope to be a long series.
"""
Examples: Configs
| config |
@ -149,16 +149,16 @@ Feature: Delete entries from journal
Scenario Outline: Delete flag with -from search operator only deletes entries since that date
Given we use the config "<config>.yaml"
When we run "jrnl --delete -from 2020-09-01" and enter
"""
Y
"""
"""
Y
"""
Then we flush the output
When we run "jrnl -99 --short"
Then the output should be
"""
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-29 11:11 Entry the first.
2020-08-31 14:32 A second entry in what I hope to be a long series.
"""
Examples: Configs
| config |
@ -169,16 +169,16 @@ Feature: Delete entries from journal
Scenario Outline: Delete flag with -to only deletes entries up to specified date
Given we use the config "<config>.yaml"
When we run "jrnl --delete -to 2020-08-31" and enter
"""
Y
Y
"""
"""
Y
Y
"""
Then we flush the output
When we run "jrnl -99 --short"
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
| config |
@ -190,16 +190,16 @@ Feature: Delete entries from journal
Scenario Outline: Delete flag with -starred only deletes starred entries
Given we use the config "<config>.yaml"
When we run "jrnl --delete -starred" and enter
"""
Y
"""
"""
Y
"""
Then we flush the output
When we run "jrnl -99 --short"
Then the output should be
"""
2020-08-29 11:11 Entry the first.
2020-09-24 09:14 The third entry finally after weeks without writing.
"""
"""
2020-08-29 11:11 Entry the first.
2020-09-24 09:14 The third entry finally after weeks without writing.
"""
Examples: Configs
| config |
@ -210,16 +210,16 @@ Feature: Delete entries from journal
Scenario Outline: Delete flag with -contains only entries containing expression
Given we use the config "<config>.yaml"
When we run "jrnl --delete -contains dignissim" and enter
"""
Y
"""
"""
Y
"""
Then we flush the output
When we run "jrnl -99 --short"
Then the output should be
"""
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-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.
"""
Examples: Configs
| config |

View file

@ -22,11 +22,11 @@ Feature: Encrypting and decrypting journals
Scenario: Encrypting a journal
Given we use the config "simple.yaml"
When we run "jrnl --encrypt" and enter
"""
swordfish
swordfish
n
"""
"""
swordfish
swordfish
n
"""
Then we should see the message "Journal encrypted"
And the config for journal "default" should have "encrypt" set to "bool:True"
When we run "jrnl -n 1" and enter "swordfish"

View file

@ -1,20 +1,20 @@
Feature: Journals iteracting with the file system in a way that users can see
Scenario: Adding entries to a Folder journal should generate date files
Given we use the config "empty_folder.yaml"
When we run "jrnl 23 July 2013: Testing folder journal."
Then we should see the message "Entry added"
When the journal directory is listed
Then the output should contain "2013/07/23.txt" or "2013\07\23.txt"
Given we use the config "empty_folder.yaml"
When we run "jrnl 23 July 2013: Testing folder journal."
Then we should see the message "Entry added"
When the journal directory is listed
Then the output should contain "2013/07/23.txt" or "2013\07\23.txt"
Scenario: Adding multiple entries to a Folder journal should generate multiple date files
Given we use the config "empty_folder.yaml"
When we run "jrnl 23 July 2013: Testing folder journal."
And we run "jrnl 3/7/2014: Second entry of journal."
Then we should see the message "Entry added"
When the journal directory is listed
Then the output should contain "2013/07/23.txt" or "2013\07\23.txt"
Then the output should contain "2014/03/07.txt" or "2014\03\07.txt"
Given we use the config "empty_folder.yaml"
When we run "jrnl 23 July 2013: Testing folder journal."
And we run "jrnl 3/7/2014: Second entry of journal."
Then we should see the message "Entry added"
When the journal directory is listed
Then the output should contain "2013/07/23.txt" or "2013\07\23.txt"
Then the output should contain "2014/03/07.txt" or "2014\03\07.txt"
Scenario: If the journal and it's parent directory don't exist, they should be created
Given we use the config "missing_directory.yaml"
@ -37,10 +37,10 @@ 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
Given we use the config "missingconfig"
When we run "jrnl hello world" and enter
"""
test.txt
n
"""
"""
test.txt
n
"""
And we change directory to "features"
And we run "jrnl -n 1"
Then the output should contain "hello world"

View file

@ -60,64 +60,64 @@ Feature: Custom formats
And we load template "sample.template"
When we run "jrnl --export sample"
Then the output should be
"""
My first entry.
---------------
"""
My first entry.
---------------
Everything is alright
Everything is alright
Life is good.
-------------
Life is good.
-------------
But I'm better.
"""
But I'm better.
"""
Scenario: Increasing Headings on Markdown export
Given we use the config "markdown-headings-335.yaml"
When we run "jrnl --export markdown"
Then the output should be
"""
# 2015
"""
# 2015
## April
## April
### 2015-04-14 13:23 Heading Test
### 2015-04-14 13:23 Heading Test
#### H1-1
#### H1-1
#### H1-2
#### H1-2
#### H1-3
#### H1-3
##### H2-1
##### H2-1
##### H2-2
##### H2-2
##### H2-3
##### H2-3
Horizontal Rules (ignore)
Horizontal Rules (ignore)
---
---
===
===
#### ATX H1
#### ATX H1
##### ATX H2
##### ATX H2
###### ATX H3
###### ATX H3
####### ATX H4
####### ATX H4
######## ATX H5
######## ATX H5
######### ATX H6
######### ATX H6
Stuff
Stuff
More stuff
more stuff again
"""
More stuff
more stuff again
"""
# the "deletion" journal is used because it doesn't have a newline at the
# end of the last entry
@ -127,20 +127,20 @@ Feature: Custom formats
Given we use the config "deletion.yaml"
When we run "jrnl --format markdown"
Then the output should be
"""
# 2019
"""
# 2019
## October
## October
### 2019-10-29 11:11 First entry.
### 2019-10-29 11:11 First entry.
### 2019-10-29 11:11 Second entry.
### 2019-10-29 11:11 Second entry.
### 2019-10-29 11:13 Third entry.
### 2019-10-29 11:13 Third entry.
"""
"""
Scenario: Exporting to XML
Given we use the config "tags.yaml"
@ -154,11 +154,11 @@ Feature: Custom formats
Given we use the config "tags.yaml"
When we run "jrnl --export tags"
Then the output should be
"""
@idea : 2
@journal : 1
@dan : 1
"""
"""
@idea : 2
@journal : 1
@dan : 1
"""
Scenario: Exporting fancy
Given we use the config "tags.yaml"
@ -210,34 +210,34 @@ Feature: Custom formats
And we create cache directory "bug768"
When we run "jrnl --export yaml -o {cache_dir}" with cache directory "bug768"
Then cache directory "bug768" should contain the files
"""
[
"2019-10-29_first-entry.md",
"2019-10-29_second-entry.md",
"2019-10-29_third-entry.md"
]
"""
"""
[
"2019-10-29_first-entry.md",
"2019-10-29_second-entry.md",
"2019-10-29_third-entry.md"
]
"""
And the content of file "2019-10-29_third-entry.md" in cache directory "bug768" should be
"""
title: Third entry.
date: 2019-10-29 11:13
starred: False
tags:
"""
title: Third entry.
date: 2019-10-29 11:13
starred: False
tags:
"""
"""
Scenario: Printing a journal that has multiline entries
Given we use the config "multiline.yaml"
When we run "jrnl -n 1"
Then we should get no error
And the output should be
"""
2013-06-09 15:39 Multiple line entry.
| This is the first line.
| This line doesn't have any ending punctuation
|
| There is a blank line above this.
"""
"""
2013-06-09 15:39 Multiple line entry.
| This is the first line.
| This line doesn't have any ending punctuation
|
| There is a blank line above this.
"""
Scenario: Exporting dayone to json
Given we use the config "dayone.yaml"

View file

@ -19,15 +19,15 @@ Feature: Importing data
Given we use the config "<config>.yaml"
And we use the password "test" if prompted
When we run "jrnl --import" and pipe
"""
[2020-07-05 15:00] Observe and import.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent malesuada quis
est ac dignissim. Aliquam dignissim rutrum pretium. Phasellus pellentesque augue
et venenatis facilisis. Suspendisse potenti. Sed dignissim sed nisl eu consequat.
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
dolor dui end of entry.
"""
"""
[2020-07-05 15:00] Observe and import.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent malesuada quis
est ac dignissim. Aliquam dignissim rutrum pretium. Phasellus pellentesque augue
et venenatis facilisis. Suspendisse potenti. Sed dignissim sed nisl eu consequat.
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
dolor dui end of entry.
"""
Then we flush the output
When we run "jrnl -on 2020-07-05"
Then the output should contain "2020-07-05 15:00 Observe and import."
@ -45,13 +45,13 @@ Feature: Importing data
Given we use the config "<config>.yaml"
And we use the password "test" if prompted
When we run "jrnl --import" and pipe
"""
[2020-07-05 15:00] Observe and import.
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
"""
[2020-07-05 15:00] Observe and import.
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
[2020-07-05 15:01] Twice as nice.
Sed dignissim sed nisl eu consequat.
"""
[2020-07-05 15:01] Twice as nice.
Sed dignissim sed nisl eu consequat.
"""
Then we flush the output
When we run "jrnl -on 2020-07-05"
Then the output should contain "2020-07-05 15:00 Observe and import."
@ -84,9 +84,9 @@ Feature: Importing data
But the journal should not contain "I have an @idea"
And the journal should not contain "I met with"
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!
"""
Then the journal should contain "My first entry."
And the journal should contain "PROFIT!"
But the journal should not contain "I should not exist!"

View file

@ -43,9 +43,9 @@ Feature: Multiple journals
Scenario: Don't crash if no file exists for a configured encrypted journal
Given we use the config "multiple.yaml"
When we run "jrnl new_encrypted Adding first entry" and enter
"""
these three eyes
these three eyes
n
"""
"""
these three eyes
these three eyes
n
"""
Then we should see the message "Encrypted journal 'new_encrypted' created"

View file

@ -4,11 +4,11 @@ Feature: Using the installed keyring
Given we use the config "multiple.yaml"
And we have a keyring
When we run "jrnl simple --encrypt" and enter
"""
sabertooth
sabertooth
y
"""
"""
sabertooth
sabertooth
y
"""
Then the config for journal "simple" should have "encrypt" set to "bool:True"
When we run "jrnl simple -n 1"
Then the output should contain "2013-06-10 15:40 Life is good"
@ -18,11 +18,11 @@ Feature: Using the installed keyring
And we do not have a keyring
When we run "jrnl test entry"
And we run "jrnl --encrypt" and enter
"""
password
password
n
"""
"""
password
password
n
"""
Then we should get no error
Scenario: Encrypt journal with no keyring backend and do store in keyring
@ -30,11 +30,11 @@ Feature: Using the installed keyring
And we do not have a keyring
When we run "jrnl test entry"
And we run "jrnl --encrypt" and enter
"""
password
password
y
"""
"""
password
password
y
"""
Then we should get no error
# @todo add step to check contents of keyring
@ -59,10 +59,10 @@ Feature: Using the installed keyring
Scenario: Mistyping your password
Given we use the config "simple.yaml"
When we run "jrnl --encrypt" and enter
"""
swordfish
sordfish
"""
"""
swordfish
sordfish
"""
Then we should be prompted for a password
And we should see the message "Passwords did not match"
And the config for journal "default" should not have "encrypt" set
@ -71,13 +71,13 @@ Feature: Using the installed keyring
Scenario: Mistyping your password, then getting it right
Given we use the config "simple.yaml"
When we run "jrnl --encrypt" and enter
"""
swordfish
sordfish
swordfish
swordfish
n
"""
"""
swordfish
sordfish
swordfish
swordfish
n
"""
Then we should be prompted for a password
And we should see the message "Passwords did not match"
And we should see the message "Journal encrypted"

View file

@ -27,7 +27,7 @@ Feature: Searching in a journal
Then the output should contain "Adding an entry right now."
And the output should contain "A future entry."
And the output should not contain "This thing happened yesterday"
Examples: configs
| config |
| simple |
@ -58,9 +58,9 @@ Feature: Searching in a journal
When we run "jrnl -contains first --short"
Then we should get no error
And the output should be
"""
2020-08-29 11:11 Entry the first.
"""
"""
2020-08-29 11:11 Entry the first.
"""
Examples: configs
| config |
@ -119,30 +119,30 @@ Feature: Searching in a journal
| basic_dayone |
Scenario: Out of order entries to a Folder journal should be listed in date order
Given we use the config "empty_folder.yaml"
When we run "jrnl 3/7/2014 4:37pm: Second entry of journal."
Then we should see the message "Entry added"
When we run "jrnl 23 July 2013: Testing folder journal."
Then we should see the message "Entry added"
When we run "jrnl -2"
Then the output should be
"""
2013-07-23 09:00 Testing folder journal.
Given we use the config "empty_folder.yaml"
When we run "jrnl 3/7/2014 4:37pm: Second entry of journal."
Then we should see the message "Entry added"
When we run "jrnl 23 July 2013: Testing folder journal."
Then we should see the message "Entry added"
When we run "jrnl -2"
Then the output should be
"""
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
Given we use the config "<config>.yaml"
When we run "jrnl --tags"
Then we should get no error
And the output should be
"""
@tagtwo : 2
@tagone : 2
@tagthree : 1
@ipsum : 1
"""
"""
@tagtwo : 2
@tagone : 2
@tagthree : 1
@ipsum : 1
"""
Examples: configs
| config |
@ -155,10 +155,10 @@ Feature: Searching in a journal
When we run "jrnl -from 'september 2020' --tags"
Then we should get no error
And the output should be
"""
@tagthree : 1
@tagone : 1
"""
"""
@tagthree : 1
@tagone : 1
"""
Examples: configs
| config |
@ -170,10 +170,10 @@ Feature: Searching in a journal
Given we use the config "<config>.yaml"
When we run "jrnl --tags -not @tagtwo"
Then the output should be
"""
@tagthree : 1
@tagone : 1
"""
"""
@tagthree : 1
@tagone : 1
"""
Examples: configs
| config |
@ -185,9 +185,9 @@ Feature: Searching in a journal
Given we use the config "<config>.yaml"
When we run "jrnl --tags -not @tagone -not @tagthree"
Then the output should be
"""
@tagtwo : 1
"""
"""
@tagtwo : 1
"""
Examples: configs
| config |
@ -206,23 +206,23 @@ Feature: Searching in a journal
When we run "jrnl -2"
Then we should get no error
And the output should be
"""
2013-06-09 15:39 My first entry.
| Everything is alright
"""
2013-06-09 15:39 My first entry.
| Everything is alright
2013-06-10 15:40 Life is good.
| But I'm better.
"""
2013-06-10 15:40 Life is good.
| But I'm better.
"""
Scenario: Loading a DayOne Journal
Given we use the config "dayone.yaml"
When we run "jrnl -from 'feb 2013'"
Then we should get no error
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!
"""

View file

@ -9,7 +9,7 @@ Feature: Starring entries
Examples: configs
| config_file |
| simple |
| simple |
| empty_folder |
| dayone |
@ -23,7 +23,7 @@ Feature: Starring entries
Examples: configs
| config_file |
| simple |
| simple |
| empty_folder |
| dayone_empty |

View file

@ -8,11 +8,11 @@ Feature: Tagging
When we run "jrnl --tags -on 2020-09-26"
Then we should get no error
And the output should be
"""
@os/2 : 1
@c++ : 1
@c# : 1
"""
"""
@os/2 : 1
@c++ : 1
@c# : 1
"""
Examples: configs
| config |
@ -36,31 +36,15 @@ Feature: Tagging
| basic_folder |
| basic_dayone |
Scenario Outline: Emails addresses should not be parsed as tags
Given we use the config "<config>.yaml"
When we run "jrnl 2020-09-26: The email address test@example.com doesn't seem to work for me"
When we run "jrnl 2020-09-26: The email address test@example.org also doesn't work for me"
When we run "jrnl 2020-09-26: I tried test@example.org and test@example.edu too"
Then we flush the output
When we run "jrnl --tags -on 2020-09-26"
Then we should get no error
And the output should be "[No tags found in journal.]"
Examples: configs
| config |
| basic_onefile |
| basic_folder |
| basic_dayone |
Scenario Outline: Entry can start and end with tags
Given we use the config "<config>.yaml"
When we run "jrnl 2020-09-26: @foo came over, we went to a @bar"
When we run "jrnl --tags -on 2020-09-26"
Then the output should be
"""
@foo : 1
@bar : 1
"""
"""
@foo : 1
@bar : 1
"""
Examples: configs
| config |

View file

@ -5,22 +5,22 @@ Feature: Upgrading Journals from 1.x.x to 2.x.x
When we run "jrnl -9" and enter "Y"
Then the journal should have 2 entries
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
"""
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
Given we use the config "encrypted_old.json"
When we run "jrnl -n 1" and enter
"""
Y
bad doggie no biscuit
bad doggie no biscuit
"""
"""
Y
bad doggie no biscuit
bad doggie no biscuit
"""
Then we should be prompted for a password
And the output should contain "2013-06-10 15:40 Life is good"
@ -28,44 +28,44 @@ Feature: Upgrading Journals from 1.x.x to 2.x.x
Given we use the config "no_colors.yaml"
When we run "jrnl -n 1"
Then the config should have "colors" set to
"""
{
'date':'none',
'title':'none',
'body':'none',
'tags':'none'
}
"""
"""
{
'date':'none',
'title':'none',
'body':'none',
'tags':'none'
}
"""
Scenario: Upgrade and parse journals with little endian date format
Given we use the config "upgrade_from_195_little_endian_dates.json"
When we run "jrnl -9" and enter "Y"
Then the journal should have 2 entries
And 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.
"""
And the output should contain
"""
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
Given we use the config "upgrade_from_195_with_missing_journal.json"
When we run "jrnl -ls" and enter
""""
Y
"""
""""
Y
"""
Then the output should contain "Error: features/journals/missing.journal does not exist."
And we should get no error
Scenario: Upgrade with missing encrypted journal
Given we use the config "upgrade_from_195_with_missing_encrypted_journal.json"
When we run "jrnl -ls" and enter
"""
Y
bad doggie no biscuit
"""
"""
Y
bad doggie no biscuit
"""
Then the output should contain "Error: features/journals/missing.journal does not exist."
And the error output should contain "We're all done"
And we should get no error

View file

@ -54,7 +54,8 @@ Feature: Writing new entries.
| editor_empty_folder |
| dayone |
@todo # this might need a new step for editors + encryption
# this might need a new step for editors + encryption
@todo
Scenario: Writing an empty entry from the editor in encrypted journal should yield "Nothing saved to file" message
Given we use the config "editor_encrypted.yaml"
#When we open the editor and enter nothing
@ -69,14 +70,16 @@ Feature: Writing new entries.
Examples: configs
| config_file |
| simple |
| simple |
| empty_folder |
@todo # There is a problem with DayOne behave tests and console input
@todo
Scenario: Writing an empty entry from the command line in DayOne journal
# There is a problem with DayOne behave tests and console input
@todo # Need some steps for encryption + editor
@todo
Scenario: Writing an empty entry from the command line in encrypted journal
# Need some steps for encryption + editor
Scenario Outline: Writing an empty entry from the editor should yield nothing
Given we use the config "<config_file>.yaml"
@ -116,10 +119,10 @@ Feature: Writing new entries.
Then we should see the message "Entry added"
When we run "jrnl -1"
Then the output should be
"""
2014-04-24 09:00 Created a new website - empty.com.
| Hope to get a lot of traffic.
"""
"""
2014-04-24 09:00 Created a new website - empty.com.
| Hope to get a lot of traffic.
"""
Examples: configs
| config_file |
@ -159,8 +162,9 @@ Feature: Writing new entries.
| empty_folder |
| encrypted |
@todo # Need to test DayOne w/out an editor
@todo
Scenario: Writing an entry at the prompt (no editor) in DayOne journal
# Need to test DayOne w/out an editor
Scenario: Writing into Dayone
Given we use the config "dayone.yaml"
@ -188,10 +192,10 @@ Feature: Writing new entries.
Then we should see the message "Entry added"
When we run "jrnl -1"
Then the output should be
"""
2014-04-24 09:00 Ran 6.2 miles today in 1:02:03.
| I'm feeling sore because I forgot to stretch.
"""
"""
2014-04-24 09:00 Ran 6.2 miles today in 1:02:03.
| I'm feeling sore because I forgot to stretch.
"""
Scenario: Opening an folder that's not a DayOne folder should treat as folder journal
Given we use the config "empty_folder.yaml"