standardize behave tests

This commit is contained in:
Jonathan Wren 2020-07-06 23:08:30 -07:00
parent 6b73eb786e
commit 131477c7e3
No known key found for this signature in database
GPG key ID: 43D5FF8722E7F68A
15 changed files with 291 additions and 309 deletions

View file

@ -4,7 +4,7 @@ Feature: Basic reading and writing to a journal
Given we use the config "basic.yaml"
When we run "jrnl -n 2"
Then we should get no error
and the output should be
And the output should be
"""
2013-06-09 15:39 My first entry.
| Everything is alright
@ -17,7 +17,7 @@ Feature: Basic reading and writing to a journal
Given we use the config "multiline.yaml"
When we run "jrnl -n 1"
Then we should get no error
and the output should be
And the output should be
"""
2013-06-09 15:39 Multiple line entry.
| This is the first line.
@ -29,13 +29,13 @@ Feature: Basic reading and writing to a journal
Scenario: Multiline entry with punctuation
Given we use the config "basic.yaml"
When we run "jrnl This is. the title\\n This is the second line"
and we run "jrnl -n 1"
And we run "jrnl -n 1"
Then the output should contain "This is. the title"
Scenario: Single line entry with punctuation
Given we use the config "basic.yaml"
When we run "jrnl This is. the title"
and we run "jrnl -n 1"
And we run "jrnl -n 1"
Then the output should contain "| the title"
Scenario: Writing an entry from command line
@ -62,10 +62,7 @@ Feature: Basic reading and writing to a journal
Scenario: Writing an empty entry from the command line
Given we use the config "basic.yaml"
When we run "jrnl" and enter nothing
Then the output should be
"""
"""
Then the output should be empty
Scenario: Filtering for dates
Given we use the config "basic.yaml"
@ -80,14 +77,14 @@ Feature: Basic reading and writing to a journal
Then we should see the message "Entry added"
When we run "jrnl -n 1"
Then the output should contain "🌞"
and the output should contain "🐘"
And the output should contain "🐘"
Scenario: Writing an entry at the prompt
Given we use the config "basic.yaml"
When we run "jrnl" and enter "25 jul 2013: I saw Elvis. He's alive."
Then we should get no error
and the journal should contain "[2013-07-25 09:00] I saw Elvis."
and the journal should contain "He's alive."
And the journal should contain "[2013-07-25 09:00] I saw Elvis."
And the journal should contain "He's alive."
Scenario: Displaying the version number
Given we use the config "basic.yaml"
@ -117,18 +114,18 @@ Feature: Basic reading and writing to a journal
Scenario: Journal directory does not exist
Given we use the config "missing_directory.yaml"
When we run "jrnl Life is good"
and we run "jrnl -n 1"
And we run "jrnl -n 1"
Then the output should contain "Life is good"
Scenario: Installation with relative journal and referencing from another folder
Given we use the config "missingconfig"
When we run "jrnl hello world" and enter
"""
test.txt
n
"""
and we change directory to "features"
and we run "jrnl -n 1"
"""
test.txt
n
"""
And we change directory to "features"
And we run "jrnl -n 1"
Then the output should contain "hello world"
Scenario: --diagnostic runs without exceptions