move tests to be more behavior driven

This commit is contained in:
Jonathan Wren 2020-09-19 11:51:39 -07:00
parent d1692ab771
commit 607aa7a5a1
No known key found for this signature in database
GPG key ID: 43D5FF8722E7F68A
3 changed files with 24 additions and 21 deletions

View file

@ -6,29 +6,10 @@ Feature: Core functionality of jrnl outside of actually handling journals
Then we should get no error Then we should get no error
Then the output should contain "version" Then the output should contain "version"
Scenario: --short displays the short version of entries (only the title)
Given we use the config "basic.yaml"
When we run "jrnl -on 2013-06-10 --short"
Then the output should be "2013-06-10 15:40 Life is good."
Scenario: -s displays the short version of entries (only the title)
Given we use the config "basic.yaml"
When we run "jrnl -on 2013-06-10 -s"
Then the output should be "2013-06-10 15:40 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"
Then the output should contain "hello world"
Scenario: --diagnostic runs without exceptions Scenario: --diagnostic runs without exceptions
When we run "jrnl --diagnostic" When we run "jrnl --diagnostic"
Then the output should contain "jrnl" Then the output should contain "jrnl"
And the output should contain "Python" And the output should contain "Python"
@todo
Scenario: --list outputs to user without exceptions

View file

@ -33,3 +33,14 @@ Feature: Journals iteracting with the file system in a way that users can see
When we run "jrnl -n 1" When we run "jrnl -n 1"
Then the output should contain "This is a new entry in my journal" Then the output should contain "This is a new entry in my journal"
And the journal should have 1 entry And the journal should have 1 entry
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
"""
And we change directory to "features"
And we run "jrnl -n 1"
Then the output should contain "hello world"

View file

@ -218,3 +218,14 @@ Feature: Custom formats
Given we use the config "bug780.yaml" Given we use the config "bug780.yaml"
When we run "jrnl --short" When we run "jrnl --short"
Then we should get no error Then we should get no error
Scenario: --short displays the short version of entries (only the title)
Given we use the config "basic.yaml"
When we run "jrnl -on 2013-06-10 --short"
Then the output should be "2013-06-10 15:40 Life is good."
Scenario: -s displays the short version of entries (only the title)
Given we use the config "basic.yaml"
When we run "jrnl -on 2013-06-10 -s"
Then the output should be "2013-06-10 15:40 Life is good."