mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-20 21:18:32 +02:00
Check message on stderr and patch subprocess.call
This commit is contained in:
parent
c0a1c171f1
commit
ccb55392dd
2 changed files with 7 additions and 5 deletions
|
@ -23,8 +23,8 @@ Feature: Basic reading and writing to a journal
|
||||||
# Note that the expected output is actually "[Nothing saved to file]" but due to mocking limitations, we expect no output here.
|
# Note that the expected output is actually "[Nothing saved to file]" but due to mocking limitations, we expect no output here.
|
||||||
Scenario: Writing an empty entry from the editor
|
Scenario: Writing an empty entry from the editor
|
||||||
Given we use the config "editor.yaml"
|
Given we use the config "editor.yaml"
|
||||||
When we open the editor and exit
|
When we open the editor and enter ""
|
||||||
Then the output should be empty
|
Then we should see the message "[Nothing saved to file]"
|
||||||
|
|
||||||
Scenario: Filtering for dates
|
Scenario: Filtering for dates
|
||||||
Given we use the config "basic.yaml"
|
Given we use the config "basic.yaml"
|
||||||
|
|
|
@ -67,9 +67,11 @@ def set_config(context, config_file):
|
||||||
cf.write("version: {}".format(__version__))
|
cf.write("version: {}".format(__version__))
|
||||||
|
|
||||||
|
|
||||||
@when('we open the editor and exit')
|
@when('we open the editor and enter')
|
||||||
def open_editor_and_exit_without_entering_text(context):
|
@when('we open the editor and enter {text}')
|
||||||
with patch('jrnl.util.get_text_from_editor', return_value=""):
|
def open_editor_and_enter(context, text=""):
|
||||||
|
text = (text or context.text)
|
||||||
|
with patch('subprocess.call', return_value=text):
|
||||||
run(context, "jrnl")
|
run(context, "jrnl")
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue