mirror of
https://github.com/nvbn/thefuck.git
synced 2025-01-19 04:21:14 +00:00
#N/A Completely test rules.gulp_not_task
This commit is contained in:
parent
3438d6dde7
commit
052f415d94
@ -1,4 +1,5 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
from io import BytesIO
|
||||||
from tests.utils import Command
|
from tests.utils import Command
|
||||||
from thefuck.rules.gulp_not_task import match, get_new_command
|
from thefuck.rules.gulp_not_task import match, get_new_command
|
||||||
|
|
||||||
@ -22,7 +23,7 @@ def test_not_march(script, stdout):
|
|||||||
|
|
||||||
|
|
||||||
def test_get_new_command(mocker):
|
def test_get_new_command(mocker):
|
||||||
mocker.patch('thefuck.rules.gulp_not_task.get_gulp_tasks', return_value=[
|
mock = mocker.patch('subprocess.Popen')
|
||||||
'serve', 'build', 'default'])
|
mock.return_value.stdout = BytesIO(b'serve \nbuild \ndefault \n')
|
||||||
command = Command('gulp srve', stdout('srve'))
|
command = Command('gulp srve', stdout('srve'))
|
||||||
assert get_new_command(command) == ['gulp serve', 'gulp default']
|
assert get_new_command(command) == ['gulp serve', 'gulp default']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user