Add new input_method "type"

This does the same thing as input_method "pipe" but is more clear what
it's doing (typing text into the builtin composer)
This commit is contained in:
Jonathan Wren 2022-06-11 12:15:49 -07:00
parent ac05bc67ce
commit 6d18e75559
5 changed files with 6 additions and 6 deletions

View file

@ -69,7 +69,7 @@ Feature: Reading and writing to journal with custom date formats
Scenario: Writing an entry at the prompt with custom date
Given we use the config "little_endian_dates.yaml"
When we run "jrnl" and pipe "2013-05-10: I saw Elvis. He's alive."
When we run "jrnl" and type "2013-05-10: I saw Elvis. He's alive."
Then we should get no error
When we run "jrnl -999"
Then the output should contain "10.05.2013 09:00 I saw Elvis."

View file

@ -3,7 +3,7 @@ Feature: Implementing Runtime Overrides for Select Configuration Keys
Scenario: Override configured editor with built-in input === editor:''
Given we use the config "basic_encrypted.yaml"
And we use the password "test" if prompted
When we run "jrnl --config-override editor ''" and pipe
When we run "jrnl --config-override editor ''" and type
This is a journal entry
Then the stdin prompt should have been called
And the editor should not have been called

View file

@ -172,7 +172,7 @@ Feature: Writing new entries.
Scenario Outline: Writing an entry at the prompt (no editor) should store the entry
Given we use the config "<config_file>"
And we use the password "bad doggie no biscuit" if prompted
When we run "jrnl" and pipe "25 jul 2013: I saw Elvis. He's alive."
When we run "jrnl" and type "25 jul 2013: I saw Elvis. He's alive."
Then we should get no error
When we run "jrnl -on '2013-07-25'"
Then the output should contain "2013-07-25 09:00 I saw Elvis."

View file

@ -273,8 +273,8 @@ def stdin_input(request, is_tty):
@fixture
def is_tty(input_method):
assert input_method in ["", "enter", "pipe"]
return input_method != "pipe"
assert input_method in ["", "enter", "pipe", "type"]
return input_method not in ["pipe", "type"]
@fixture

View file

@ -21,7 +21,7 @@ def when_we_change_directory(directory_name):
# These variables are used in the `@when(re(...))` section below
command = '(?P<command>[^"]*)'
input_method = "(?P<input_method>enter|pipe)"
input_method = "(?P<input_method>enter|pipe|type)"
all_input = '("(?P<all_input>[^"]*)")'