Add ability to put --edit partly through a cli entry to move it to the editor (#1091)

also add some functionality to test suite to see what the editor file contents were and make assertions about it
This commit is contained in:
Jonathan Wren 2020-11-21 15:20:21 -08:00 committed by GitHub
parent 336936651f
commit cfdd05358a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 56 additions and 5 deletions

View file

@ -43,6 +43,26 @@ Feature: Writing new entries.
| dayone |
| encrypted |
Scenario Outline: Writing a partial entry from command line with edit flag should go to the editor
Given we use the config "<config_file>.yaml"
And we use the password "test" if prompted
When we run "jrnl this is a partial --edit"
Then we should see the message "Entry added"
Then the editor should have been called
And the editor file content should be
"""
this is a partial
"""
When we run "jrnl -n 1"
Then the output should contain "this is a partial"
Examples: configs
| config_file |
| basic_onefile |
| basic_encrypted |
| basic_dayone |
| basic_folder |
Scenario Outline: Writing an empty entry from the editor should yield "Nothing saved to file" message
Given we use the config "<config_file>.yaml"
And we use the password "test" if prompted