Corrected BDD tests

This commit is contained in:
Jonathan van der Steege 2022-06-14 19:55:35 +02:00
parent 15dcfcc06d
commit fdc31798fc
3 changed files with 18 additions and 4 deletions

View file

@ -164,7 +164,9 @@ def load_config(config_path):
if duplicate_keys:
print_msg(
Message(
MsgText.ConfigDoubleKeys, MsgStyle.WARNING, {"duplicate_keys": duplicate_keys}
MsgText.ConfigDoubleKeys,
MsgStyle.WARNING,
{"duplicate_keys": duplicate_keys},
)
)

View file

@ -104,7 +104,19 @@ Feature: Multiple journals
When we run "jrnl --cf empty_file.yaml"
Then the error output should contain "Unable to parse config file"
Scenario: Show a warning message when the config file contains double keys at the same level
Given we use the config "double_keys.yaml"
Scenario: Show a warning message when the config file contains duplicate keys at the same level
Given the config "duplicate_keys.yaml" exists
And we use the config "duplicate_keys.yaml"
When we run "jrnl -1"
Then the output should contain "One or more keys appear multiple times at the same level"
Scenario: Show a warning message when using --config-file with duplicate keys
Given the config "duplicate_keys.yaml" exists
And we use the config "multiple.yaml"
When we run "jrnl --cf duplicate_keys.yaml -1"
Then the output should contain "One or more keys appear multiple times at the same level"
Scenario: Don't show a duplicate keys warning message when using --config-override on an existing value
Given we use the config "multiple.yaml"
When we run "jrnl --config-override highlight false"
Then the output should not contain "One or more keys appear multiple times at the same level"