From 8a4fe0ec81760db06e119fd374fd74d0e4837985 Mon Sep 17 00:00:00 2001 From: Micah Ellison <4383304+micahellison@users.noreply.github.com> Date: Sat, 29 Feb 2020 13:29:19 -0800 Subject: [PATCH] Fix FolderJournal path tests for Windows paths --- features/folder.feature | 7 +++---- features/steps/core.py | 5 +++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/features/folder.feature b/features/folder.feature index b747e6c1..650ac53e 100644 --- a/features/folder.feature +++ b/features/folder.feature @@ -15,7 +15,7 @@ Feature: Testing a journal with a root directory and multiple files in the forma When we run "jrnl 23 July 2013: Testing folder journal." Then we should see the message "Entry added" When the journal directory is listed - Then the output should contain "2013/07/23.txt" + Then the output should contain "2013/07/23.txt" or "2013\07\23.txt" Scenario: Adding multiple entries to a Folder journal should generate multiple date files @@ -24,9 +24,8 @@ Feature: Testing a journal with a root directory and multiple files in the forma And we run "jrnl 3/7/2014: Second entry of journal." Then we should see the message "Entry added" When the journal directory is listed - Then the output should contain "2013/07/23.txt" - And the output should contain "2014/03/07.txt" - + Then the output should contain "2013/07/23.txt" or "2013\07\23.txt" + Then the output should contain "2014/03/07.txt" or "2014\03\07.txt" Scenario: Out of order entries to a Folder journal should be listed in date order Given we use the config "empty_folder.yaml" diff --git a/features/steps/core.py b/features/steps/core.py index 6ada7b2f..98822813 100644 --- a/features/steps/core.py +++ b/features/steps/core.py @@ -210,10 +210,11 @@ def check_output_time_inline(context, text): @then("the output should contain") @then('the output should contain "{text}"') -def check_output_inline(context, text=None): +@then('the output should contain "{text}" or "{text2}"') +def check_output_inline(context, text=None, text2=None): text = text or context.text out = context.stdout_capture.getvalue() - assert text in out, text + assert (text in out or text2 in out), text or text2 @then('the output should not contain "{text}"')