diff --git a/features/steps/core.py b/features/steps/core.py index a97e5009..00fe01df 100644 --- a/features/steps/core.py +++ b/features/steps/core.py @@ -216,6 +216,15 @@ def check_output_inline(context, text=None, text2=None): assert text in out or text2 in out, text or text2 +@then("the error output should contain") +@then('the error output should contain "{text}"') +@then('the error output should contain "{text}" or "{text2}"') +def check_output_inline(context, text=None, text2=None): + text = text or context.text + out = context.stderr_capture.getvalue() + assert text in out or text2 in out, text or text2 + + @then('the output should not contain "{text}"') def check_output_not_inline(context, text): out = context.stdout_capture.getvalue() diff --git a/features/upgrade.feature b/features/upgrade.feature index e05d4351..b0a54c16 100644 --- a/features/upgrade.feature +++ b/features/upgrade.feature @@ -45,6 +45,7 @@ Feature: Upgrading Journals from 1.x.x to 2.x.x Y """ Then the output should contain "Error: features/journals/missing.journal does not exist." + And we should get no error Scenario: Upgrade with missing encrypted journal Given we use the config "upgrade_from_195_with_missing_encrypted_journal.json" @@ -52,7 +53,7 @@ Feature: Upgrading Journals from 1.x.x to 2.x.x """ Y bad doggie no biscuit - bad doggie no biscuit """ Then the output should contain "Error: features/journals/missing.journal does not exist." - and the output should contain "We're all done here" + And the error output should contain "We're all done" + And we should get no error diff --git a/jrnl/cli.py b/jrnl/cli.py index 52ca8c19..3f331217 100644 --- a/jrnl/cli.py +++ b/jrnl/cli.py @@ -180,7 +180,7 @@ def parse_args(args=None): action="store_true", help="Opens an interactive interface for deleting entries.", ) - + # Handle '-123' as a shortcut for '-n 123' num = re.compile(r"^-(\d+)$") if args is None: