mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 08:38:32 +02:00
Tests for parsing issue fix
This commit is contained in:
parent
b4e578b63a
commit
539a88ed14
4 changed files with 36 additions and 15 deletions
11
features/data/configs/upgrade_from_195.json
Normal file
11
features/data/configs/upgrade_from_195.json
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"default_hour": 9,
|
||||
"timeformat": "%Y-%m-%d %H:%M",
|
||||
"linewrap": 80,
|
||||
"encrypt": false,
|
||||
"editor": "",
|
||||
"default_minute": 0,
|
||||
"highlight": true,
|
||||
"journals": {"default": "features/journals/simple_jrnl-1-9-5.journal"},
|
||||
"tagsymbols": "@"
|
||||
}
|
|
@ -1,5 +1,3 @@
|
|||
2013-06-09 15:39 My first entry.
|
||||
Everything is alright
|
||||
2010-06-10 15:00 A life without chocolate is like a bad analogy.
|
||||
|
||||
2013-06-10 15:40 Life is good.
|
||||
But I'm better.
|
||||
2013-06-10 15:40 He said "[this] is the best time to be alive".
|
||||
|
|
|
@ -38,16 +38,26 @@ Feature: Zapped bugs should stay dead.
|
|||
2013-10-27 03:27 Some text.
|
||||
"""
|
||||
|
||||
Scenario: Title with an embedded period.
|
||||
Given we use the config "basic.yaml"
|
||||
When we run "jrnl 04-24-2014: Created a new website - empty.com. Hope to get a lot of traffic."
|
||||
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.
|
||||
"""
|
||||
Scenario: Title with an embedded period.
|
||||
Given we use the config "basic.yaml"
|
||||
When we run "jrnl 04-24-2014: Created a new website - empty.com. Hope to get a lot of traffic."
|
||||
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.
|
||||
"""
|
||||
|
||||
Scenario: Upgrade and parse journals with square brackets
|
||||
Given we use the config "upgrade_from_195.json"
|
||||
When we run "jrnl -2" and enter "Y"
|
||||
Then the output should contain
|
||||
"""
|
||||
2010-06-10 15:00 A life without chocolate is like a bad analogy.
|
||||
|
||||
2013-06-10 15:40 He said "[this] is the best time to be alive".
|
||||
"""
|
||||
|
||||
Scenario: Title with an embedded period on DayOne journal
|
||||
Given we use the config "dayone.yaml"
|
||||
|
|
|
@ -162,8 +162,10 @@ def check_output_time_inline(context, text):
|
|||
assert local_date in out, local_date
|
||||
|
||||
|
||||
@then('the output should contain')
|
||||
@then('the output should contain "{text}"')
|
||||
def check_output_inline(context, text):
|
||||
def check_output_inline(context, text=None):
|
||||
text = text or context.text
|
||||
out = context.stdout_capture.getvalue()
|
||||
if isinstance(out, bytes):
|
||||
out = out.decode('utf-8')
|
||||
|
|
Loading…
Add table
Reference in a new issue