mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 16:48:31 +02:00
Fix star and tag feature language and add output should be empty test
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
This commit is contained in:
parent
8faa3ae32d
commit
3d29b6b6a1
3 changed files with 38 additions and 42 deletions
|
@ -1,7 +1,7 @@
|
||||||
Feature: Starring entries
|
Feature: Starring entries
|
||||||
|
|
||||||
Scenario Outline: Starring an entry will mark it in the journal file
|
Scenario Outline: Starring an entry will mark it in the journal file
|
||||||
Given we use the config "<config_file>.yaml"
|
Given we use the config "<config_file>"
|
||||||
When we run "jrnl 20 july 2013 *: Best day of my life!"
|
When we run "jrnl 20 july 2013 *: Best day of my life!"
|
||||||
Then we should see the message "Entry added"
|
Then we should see the message "Entry added"
|
||||||
When we run "jrnl -on 2013-07-20 -starred"
|
When we run "jrnl -on 2013-07-20 -starred"
|
||||||
|
@ -9,12 +9,12 @@ Feature: Starring entries
|
||||||
|
|
||||||
Examples: configs
|
Examples: configs
|
||||||
| config_file |
|
| config_file |
|
||||||
| simple |
|
| simple.yaml |
|
||||||
| empty_folder |
|
| empty_folder.yaml |
|
||||||
| dayone |
|
| dayone.yaml |
|
||||||
|
|
||||||
Scenario Outline: Filtering by starred entries will show only starred entries
|
Scenario Outline: Filtering by starred entries will show only starred entries
|
||||||
Given we use the config "<config_file>.yaml"
|
Given we use the config "<config_file>"
|
||||||
When we run "jrnl -starred"
|
When we run "jrnl -starred"
|
||||||
Then the output should be empty
|
Then the output should be empty
|
||||||
When we run "jrnl 20 july 2013 *: Best day of my life!"
|
When we run "jrnl 20 july 2013 *: Best day of my life!"
|
||||||
|
@ -23,9 +23,9 @@ Feature: Starring entries
|
||||||
|
|
||||||
Examples: configs
|
Examples: configs
|
||||||
| config_file |
|
| config_file |
|
||||||
| simple |
|
| simple.yaml |
|
||||||
| empty_folder |
|
| empty_folder.yaml |
|
||||||
| dayone_empty |
|
| dayone_empty.yaml |
|
||||||
|
|
||||||
Scenario: Starring an entry will mark it in an encrypted journal
|
Scenario: Starring an entry will mark it in an encrypted journal
|
||||||
Given we use the config "encrypted.yaml"
|
Given we use the config "encrypted.yaml"
|
||||||
|
|
|
@ -3,51 +3,46 @@ Feature: Tagging
|
||||||
# And format.feature for tag-related output
|
# And format.feature for tag-related output
|
||||||
|
|
||||||
Scenario Outline: Tags should allow certain special characters such as /, +, #
|
Scenario Outline: Tags should allow certain special characters such as /, +, #
|
||||||
Given we use the config "<config>.yaml"
|
Given we use the config "<config_file>"
|
||||||
When we run "jrnl 2020-09-26: This is an entry about @os/2 and @c++ and @c#"
|
When we run "jrnl 2020-09-26: This is an entry about @os/2 and @c++ and @c#"
|
||||||
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 |
|
| config_file |
|
||||||
| basic_onefile |
|
| basic_onefile.yaml |
|
||||||
| basic_folder |
|
| basic_folder.yaml |
|
||||||
| basic_dayone |
|
| basic_dayone.yaml |
|
||||||
|
|
||||||
Scenario Outline: Emails addresses should not be parsed as tags
|
Scenario Outline: Emails addresses should not be parsed as tags
|
||||||
Given we use the config "<config>.yaml"
|
Given we use the config "<config_file>"
|
||||||
When we run "jrnl 2020-09-26: The email address test@example.com does not seem to work for me"
|
When we run "jrnl 2020-09-26: The email address test@example.com does not seem to work for me"
|
||||||
When we run "jrnl 2020-09-26: The email address test@example.org also does not work for me"
|
When we run "jrnl 2020-09-26: The email address test@example.org also does not work for me"
|
||||||
When we run "jrnl 2020-09-26: I tried test@example.org and test@example.edu too"
|
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"
|
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 "[No tags found in journal.]"
|
And the output should be "[No tags found in journal.]"
|
||||||
|
|
||||||
Examples: configs
|
Examples: configs
|
||||||
| config |
|
| config_file |
|
||||||
| basic_onefile |
|
| basic_onefile.yaml |
|
||||||
| basic_folder |
|
| basic_folder.yaml |
|
||||||
| basic_dayone |
|
| basic_dayone.yaml |
|
||||||
|
|
||||||
Scenario Outline: Entry can start and end with tags
|
Scenario Outline: Entry can start and end with tags
|
||||||
Given we use the config "<config>.yaml"
|
Given we use the config "<config_file>"
|
||||||
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 |
|
| config_file |
|
||||||
| basic_onefile |
|
| basic_onefile.yaml |
|
||||||
| basic_folder |
|
| basic_folder.yaml |
|
||||||
| basic_dayone |
|
| basic_dayone.yaml |
|
||||||
|
|
|
@ -419,14 +419,15 @@ def output_should_not_contain(output, cli_run):
|
||||||
assert output not in cli_run["stdout"]
|
assert output not in cli_run["stdout"]
|
||||||
|
|
||||||
|
|
||||||
@then(parse("the output should be\n{output}"))
|
@then(parse("the output should be\n{str_value}"))
|
||||||
@then(parse('the output should be "{output}"'))
|
@then(parse('the output should be "{str_value}"'))
|
||||||
@then('the output should be "<output>"')
|
@then('the output should be "<str_value>"')
|
||||||
def output_should_be(output, cli_run):
|
@then("the output should be empty")
|
||||||
|
def output_should_be(str_value, cli_run):
|
||||||
actual_out = cli_run["stdout"].strip()
|
actual_out = cli_run["stdout"].strip()
|
||||||
output = output.strip()
|
expected = str_value.strip()
|
||||||
assert output and output == actual_out, failed_msg(
|
assert expected == actual_out, failed_msg(
|
||||||
"Output does not match.", output, actual_out
|
"Output does not match.", expected, actual_out
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue