mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-06-28 05:26:13 +02:00
More graceful handling of low linewrap values (#1219)
* behavior outline * enforce positive initial linewrap Check column widths update gitignore throw error when linewrap too small simply check for large enough linewrap value * delete unused error message * PR feedback make exception more informative update check_linewrap signature in src and test make check_linewrap a free function * delete unused function * delete else..pass block * newline for make format
This commit is contained in:
parent
1f19bd9f1e
commit
dd74b14d76
5 changed files with 79 additions and 2 deletions
|
@ -323,6 +323,22 @@ Feature: Custom formats
|
|||
| basic_folder |
|
||||
| basic_dayone |
|
||||
|
||||
|
||||
|
||||
Scenario Outline: Export fancy with small linewrap
|
||||
Given we use the config "<config>.yaml"
|
||||
And we use the password "test" if prompted
|
||||
When we run "jrnl --config-override linewrap 35 --format fancy -3"
|
||||
Then we should get no error
|
||||
And the output should be 35 columns wide
|
||||
|
||||
Examples: configs
|
||||
| config |
|
||||
| basic_onefile |
|
||||
| basic_encrypted |
|
||||
| basic_folder |
|
||||
| basic_dayone |
|
||||
|
||||
@todo
|
||||
Scenario Outline: Exporting fancy
|
||||
# Needs better emoji support
|
||||
|
|
|
@ -12,6 +12,14 @@ from behave import given
|
|||
from behave import then
|
||||
|
||||
|
||||
@then("the output should be {width:d} columns wide")
|
||||
def check_output_width(context, width):
|
||||
out = context.stdout_capture.getvalue()
|
||||
out_lines = out.splitlines()
|
||||
for line in out_lines:
|
||||
assert len(line) <= width
|
||||
|
||||
|
||||
@then("the output should be parsable as json")
|
||||
def check_output_json(context):
|
||||
out = context.stdout_capture.getvalue()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue