From 3549eff21520ff677becf784e4374c3c1aa515d5 Mon Sep 17 00:00:00 2001 From: Manuel Ebert Date: Wed, 14 Aug 2013 14:00:42 -0700 Subject: [PATCH] Adds regression test for #87 --- features/regression.feature | 8 ++++++++ features/steps/core.py | 5 +++++ 2 files changed, 13 insertions(+) create mode 100644 features/regression.feature diff --git a/features/regression.feature b/features/regression.feature new file mode 100644 index 00000000..c4cf41e7 --- /dev/null +++ b/features/regression.feature @@ -0,0 +1,8 @@ +Feature: Zapped bugs should stay dead. + + Scenario: Writing an entry does not print the entire journal + Given we use the config "basic.json" + When we run "jrnl 23 july 2013: A cold and stormy day. I ate crisps on the sofa." + Then we should see the message "Entry added" + When we run "jrnl -n 1" + Then the output should not contain "Life is good" diff --git a/features/steps/core.py b/features/steps/core.py index bceab051..f6c54564 100644 --- a/features/steps/core.py +++ b/features/steps/core.py @@ -102,6 +102,11 @@ def check_output_inline(context, text): out = context.stdout_capture.getvalue() assert text in out +@then('the output should not contain "{text}"') +def check_output_not_inline(context, text): + out = context.stdout_capture.getvalue() + assert text not in out + @then('we should see the message "{text}"') def check_message(context, text): out = context.messages.getvalue()