mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-18 12:08:31 +02:00
Implement "the output should be" step
- Add another datetime test Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
This commit is contained in:
parent
51f289797b
commit
80eb5b3008
2 changed files with 30 additions and 0 deletions
|
@ -48,3 +48,22 @@ Feature: Reading and writing to journal with custom date formats
|
||||||
| little_endian_dates.yaml | 2032-02-01: Test. | 01.02.2032 09:00 Test. |
|
| little_endian_dates.yaml | 2032-02-01: Test. | 01.02.2032 09:00 Test. |
|
||||||
| little_endian_dates.yaml | 2020-01-01: Test. | 01.01.2020 09:00 Test. |
|
| little_endian_dates.yaml | 2020-01-01: Test. | 01.01.2020 09:00 Test. |
|
||||||
| little_endian_dates.yaml | 2020-12-31: Test. | 31.12.2020 09:00 Test. |
|
| little_endian_dates.yaml | 2020-12-31: Test. | 31.12.2020 09:00 Test. |
|
||||||
|
|
||||||
|
|
||||||
|
Scenario Outline: Searching for dates with custom date
|
||||||
|
Given we use the config "<config_file>"
|
||||||
|
When we run "jrnl <command>"
|
||||||
|
Then the output should be "<output>"
|
||||||
|
|
||||||
|
Examples: Day-first Dates
|
||||||
|
| config_file | command | output |
|
||||||
|
| little_endian_dates.yaml | -on '2013-07-10' --short | 10.07.2013 15:40 Life is good. |
|
||||||
|
| little_endian_dates.yaml | -on 'june 9 2013' --short | 09.06.2013 15:39 My first entry. |
|
||||||
|
| little_endian_dates.yaml | -on 'july 10 2013' --short | 10.07.2013 15:40 Life is good. |
|
||||||
|
| little_endian_dates.yaml | -on 'june 2013' --short | 09.06.2013 15:39 My first entry. |
|
||||||
|
| little_endian_dates.yaml | -on 'july 2013' --short | 10.07.2013 15:40 Life is good. |
|
||||||
|
# @todo month alone with no year should work
|
||||||
|
# | little_endian_dates.yaml | -on 'june' --short | 09.06.2013 15:39 My first entry. |
|
||||||
|
# | little_endian_dates.yaml | -on 'july' --short | 10.07.2013 15:40 Life is good. |
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -114,6 +114,17 @@ def check_output_inline(output, cli_run):
|
||||||
assert output and output in cli_run["stdout"]
|
assert output and output in cli_run["stdout"]
|
||||||
|
|
||||||
|
|
||||||
|
@then(parse("the output should be\n{output}"))
|
||||||
|
@then(parse('the output should be "{output}"'))
|
||||||
|
@then('the output should be "<output>"')
|
||||||
|
def test_check_output_inline(output, cli_run):
|
||||||
|
actual_out = cli_run["stdout"].strip()
|
||||||
|
output = output.strip()
|
||||||
|
assert (
|
||||||
|
output and output == actual_out
|
||||||
|
), f"Output does not match.\nExpected:\n{output}\n---end---\nActual:\n{actual_out}\n---end---\n"
|
||||||
|
|
||||||
|
|
||||||
@then(parse('the output should be "{expected_out}"'))
|
@then(parse('the output should be "{expected_out}"'))
|
||||||
@then(parse("the output should be\n{expected_out}"))
|
@then(parse("the output should be\n{expected_out}"))
|
||||||
def check_output(cli_run, expected_out):
|
def check_output(cli_run, expected_out):
|
||||||
|
|
Loading…
Add table
Reference in a new issue