bdd: Add "I open ... in a new tab" step.

This commit is contained in:
Florian Bruhin 2015-11-23 19:42:01 +01:00
parent 39f29e2531
commit d324dd5f70

View File

@ -42,7 +42,14 @@ def open_path_given(quteproc, path):
@bdd.when(bdd.parsers.parse("I open {path}"))
def open_path_when(quteproc, path):
quteproc.open_path(path)
new_tab_suffix = ' in a new tab'
if path.endswith(new_tab_suffix):
path = path[:-len(new_tab_suffix)]
new_tab = True
else:
new_tab = False
quteproc.open_path(path, new_tab=new_tab)
@bdd.when(bdd.parsers.parse("I set {sect} -> {opt} to {value}"))