Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for tests not handling successive input prompts #795

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion features/core.feature
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ Feature: Basic reading and writing to a journal

Scenario: Writing an entry at the prompt
Given we use the config "basic.yaml"
When we run "jrnl" and enter "25 jul 2013: I saw Elvis. He's alive."
When we run "jrnl" and enter
"""
25 jul 2013: I saw Elvis. He's alive.
"""
Then we should get no error
and the journal should contain "[2013-07-25 09:00] I saw Elvis."
and the journal should contain "He's alive."
Expand Down
5 changes: 4 additions & 1 deletion features/custom_dates.feature
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ Feature: Reading and writing to journal with custom date formats

Scenario: Writing an entry at the prompt
Given we use the config "little_endian_dates.yaml"
When we run "jrnl" and enter "2013-05-10: I saw Elvis. He's alive."
When we run "jrnl" and enter
"""
2013-05-10: I saw Elvis. He's alive.
"""
Then we should get no error
And the journal should contain "[10.05.2013 09:00] I saw Elvis."
And the journal should contain "He's alive."
20 changes: 16 additions & 4 deletions features/encryption.feature
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
Feature: Encrypted journals
Scenario: Loading an encrypted journal
Given we use the config "encrypted.yaml"
When we run "jrnl -n 1" and enter "bad doggie no biscuit"
When we run "jrnl -n 1" and enter
"""
bad doggie no biscuit
"""
Then the output should contain "Password"
And the output should contain "2013-06-10 15:40 Life is good"

Scenario: Decrypting a journal
Given we use the config "encrypted.yaml"
When we run "jrnl --decrypt" and enter "bad doggie no biscuit"
When we run "jrnl --decrypt" and enter
""""
bad doggie no biscuit
"""
Then the config for journal "default" should have "encrypt" set to "bool:False"
Then we should see the message "Journal decrypted"
And the journal should have 2 entries
Expand All @@ -23,7 +29,10 @@
"""
Then we should see the message "Journal encrypted"
And the config for journal "default" should have "encrypt" set to "bool:True"
When we run "jrnl -n 1" and enter "swordfish"
When we run "jrnl -n 1" and enter
"""
swordfish
"""
Then the output should contain "Password"
And the output should contain "2013-06-10 15:40 Life is good"

Expand All @@ -41,7 +50,10 @@
Then we should see the message "Passwords did not match"
And we should see the message "Journal encrypted"
And the config for journal "default" should have "encrypt" set to "bool:True"
When we run "jrnl -n 1" and enter "swordfish"
When we run "jrnl -n 1" and enter
"""
swordfish
"""
Then the output should contain "Password"
And the output should contain "2013-06-10 15:40 Life is good"

Expand Down
2 changes: 1 addition & 1 deletion features/steps/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def run_with_input(context, command, inputs=""):
if context.text:
text = iter(context.text.split("\n"))
else:
text = iter([inputs])
text = iter(inputs.split(" "))

args = ushlex(command)[1:]

Expand Down