1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-09-27 15:42:37 +01:00

#682: Unify work with output in classic and instant mode

This commit is contained in:
Vladimir Iakovlev
2017-08-31 17:58:56 +02:00
parent 96843fc6cd
commit 4625d8503d
237 changed files with 1322 additions and 1332 deletions

View File

@@ -1,10 +1,10 @@
import pytest
from io import BytesIO
from tests.utils import Command
from thefuck.types import Command
from thefuck.rules.gulp_not_task import match, get_new_command
def stdout(task):
def output(task):
return '''[00:41:11] Using gulpfile gulpfile.js
[00:41:11] Task '{}' is not in your gulpfile
[00:41:11] Please check the documentation for proper gulpfile formatting
@@ -12,12 +12,12 @@ def stdout(task):
def test_match():
assert match(Command('gulp srve', stdout('srve')))
assert match(Command('gulp srve', output('srve')))
@pytest.mark.parametrize('script, stdout', [
('gulp serve', ''),
('cat srve', stdout('srve'))])
('cat srve', output('srve'))])
def test_not_march(script, stdout):
assert not match(Command(script, stdout))
@@ -25,5 +25,5 @@ def test_not_march(script, stdout):
def test_get_new_command(mocker):
mock = mocker.patch('subprocess.Popen')
mock.return_value.stdout = BytesIO(b'serve \nbuild \ndefault \n')
command = Command('gulp srve', stdout('srve'))
command = Command('gulp srve', output('srve'))
assert get_new_command(command) == ['gulp serve', 'gulp default']