[Tests, Windows] fix tests that was failing on Windows due to linebreak issues

This commit is contained in:
MinchinWeb 2019-08-02 11:00:23 -06:00
parent 4cc74fed36
commit 1e40cdef06
2 changed files with 5 additions and 1 deletions

View file

@ -65,13 +65,14 @@ Feature: Zapped bugs should stay dead.
"""
Scenario: DayOne tag searching should work with tags containing a mixture of upper and lower case.
# https://github.com/maebert/jrnl/issues/354
# https://github.com/jrnl-org/jrnl/issues/354
Given we use the config "dayone.yaml"
When we run "jrnl @plAy"
Then the output should contain
"""
2013-05-17 11:39 This entry has tags!
"""
Scenario: Integers in square brackets should not be read as dates
Given we use the config "brackets.yaml"
When we run "jrnl -1"

View file

@ -190,6 +190,9 @@ def check_output_time_inline(context, text):
def check_output_inline(context, text=None):
text = text or context.text
out = context.stdout_capture.getvalue()
# make line endings consistent
text = os.linesep.join(text.splitlines())
out = os.linesep.join(out.splitlines())
if isinstance(out, bytes):
out = out.decode('utf-8')
assert text in out, text