Add WIP (broken) test

This commit is contained in:
Aaron Lichtman 2019-10-29 04:16:48 +01:00
parent 6d366035e8
commit f057689459
No known key found for this signature in database
GPG key ID: 22368077DE9F9903
4 changed files with 32 additions and 1 deletions

View file

@ -58,3 +58,16 @@ Feature: Basic reading and writing to a journal
When we run "jrnl -on 2013-06-10 -s" When we run "jrnl -on 2013-06-10 -s"
Then the output should be "2013-06-10 15:40 Life is good." Then the output should be "2013-06-10 15:40 Life is good."
# The input for this test is <SPACE><ENTER>y
Scenario: --delete flag allows deletion of single entry
Given we use the config "deletion.yaml"
When we run "jrnl --delete"
And we type " "
And we type
"""
y
"""
When we run "jrnl -on 2019-10-29 -s"
Then the output should not contain "2019-10-29 11:11 First entry."

View file

@ -0,0 +1,12 @@
default_hour: 9
default_minute: 0
editor: ""
encrypt: false
highlight: true
journals:
default: features/journals/deletion.journal
linewrap: 80
tagsymbols: "@"
template: false
timeformat: "%Y-%m-%d %H:%M"
indent_character: "|"

View file

@ -0,0 +1,5 @@
[2019-10-29 11:11] First entry.
[2019-10-29 11:11] Second entry.
[2019-10-29 11:13] Third entry.

View file

@ -7,6 +7,7 @@ try:
except ImportError: except ImportError:
from cStringIO import StringIO from cStringIO import StringIO
def before_scenario(context, scenario): def before_scenario(context, scenario):
"""Before each scenario, backup all config and journal test data.""" """Before each scenario, backup all config and journal test data."""
context.messages = StringIO() context.messages = StringIO()
@ -19,7 +20,6 @@ def before_scenario(context, scenario):
if os.path.exists(working_dir): if os.path.exists(working_dir):
shutil.rmtree(working_dir) shutil.rmtree(working_dir)
for folder in ("configs", "journals"): for folder in ("configs", "journals"):
original = os.path.join("features", "data", folder) original = os.path.join("features", "data", folder)
working_dir = os.path.join("features", folder) working_dir = os.path.join("features", folder)
@ -32,6 +32,7 @@ def before_scenario(context, scenario):
else: else:
shutil.copy2(source, working_dir) shutil.copy2(source, working_dir)
def after_scenario(context, scenario): def after_scenario(context, scenario):
"""After each scenario, restore all test data and remove working_dirs.""" """After each scenario, restore all test data and remove working_dirs."""
context.messages.close() context.messages.close()