From 1e40cdef06392f9edacf974247449cd305fcecd9 Mon Sep 17 00:00:00 2001 From: MinchinWeb Date: Fri, 2 Aug 2019 11:00:23 -0600 Subject: [PATCH] [Tests, Windows] fix tests that was failing on Windows due to linebreak issues --- features/regression.feature | 3 ++- features/steps/core.py | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/features/regression.feature b/features/regression.feature index e7d3de5f..c8fa151e 100644 --- a/features/regression.feature +++ b/features/regression.feature @@ -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" diff --git a/features/steps/core.py b/features/steps/core.py index 83981d13..3d461fcd 100644 --- a/features/steps/core.py +++ b/features/steps/core.py @@ -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