Add BDD tests for spawn command

Issue-Link: https://github.com/The-Compiler/qutebrowser/issues/999
This commit is contained in:
Philipp Hansch 2016-03-25 18:19:35 +01:00
parent 86b12a302e
commit 69da5d7545
2 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,17 @@
Feature: :spawn
Scenario: Running :spawn
When I run :spawn -v echo "Hello"
Then the message "Command exited successfully." should be shown
Scenario: Running :spawn with command that does not exist
When I run :spawn command_does_not_exist127623
Then the error "Error while spawning command: The process failed to start." should be shown
Scenario: Running :spawn with invalid quoting
When I run :spawn """
Then the error "Error while splitting command: No closing quotation" should be shown
Scenario: Running :spawn with url variable
When I run :spawn echo {url}
Then "Executing echo with args ['about:blank'], userscript=False" should be logged

View File

@ -0,0 +1,22 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# qutebrowser is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
import pytest_bdd as bdd
bdd.scenarios('spawn.feature')