unskip blank input test

This commit is contained in:
Jonathan Wren 2022-01-14 06:24:11 -08:00
parent d91f6d6d84
commit 67417c7806
2 changed files with 12 additions and 13 deletions

View file

@ -89,21 +89,21 @@ Feature: Writing new entries.
| basic_encrypted.yaml | | basic_encrypted.yaml |
| basic_onefile.yaml | | basic_onefile.yaml |
@skip
Scenario Outline: Writing an empty entry from the command line with no editor should yield nothing Scenario Outline: Writing an empty entry from the command line with no editor should yield nothing
Given we use the config "<config_file>" Given we use the config "<config_file>"
And we use the password "bad doggie no biscuit" if prompted And we use the password "test" if prompted
When we run "jrnl" and enter nothing When we run "jrnl --config-override editor ''" and enter ""
Then the output should be empty Then the stdin prompt should have been called
And the output should be empty
And the error output should contain "Writing Entry; on a blank line" And the error output should contain "Writing Entry; on a blank line"
And the editor should not have been called And the editor should not have been called
Examples: configs Examples: configs
| config_file | | config_file |
| config_simple.yaml | | basic_onefile.yaml |
| empty_folder.yaml | | basic_encrypted.yaml |
| encrypted.yaml | | basic_folder.yaml |
# | dayone | @todo # | basic_dayone.yaml | @todo
Scenario Outline: Writing an entry does not print the entire journal Scenario Outline: Writing an entry does not print the entire journal
# https://github.com/jrnl-org/jrnl/issues/87 # https://github.com/jrnl-org/jrnl/issues/87

View file

@ -20,14 +20,13 @@ def when_we_change_directory(directory_name):
# These variables are used in the `@when(re(...))` section below # These variables are used in the `@when(re(...))` section below
command = '(?P<command>[^"]+)' command = '(?P<command>[^"]*)'
input_method = "(?P<input_method>enter|pipe)" input_method = "(?P<input_method>enter|pipe)"
user_input = '(?P<user_input>[^"]+)' user_input = '("(?P<user_input>[^"]*)")'
@when(parse('we run "jrnl {command}" and {input_method}\n{user_input}')) @when(parse('we run "jrnl {command}" and {input_method}\n{user_input}'))
@when(re(f'we run "jrnl {command}" and {input_method} "{user_input}"')) @when(re(f'we run "jrnl ?{command}" and {input_method} {user_input}'))
@when(re(f'we run "jrnl" and {input_method} "{user_input}"'))
@when(parse('we run "jrnl {command}"')) @when(parse('we run "jrnl {command}"'))
@when('we run "jrnl"') @when('we run "jrnl"')
def we_run_jrnl(cli_run, capsys, keyring): def we_run_jrnl(cli_run, capsys, keyring):