mirror of
https://github.com/nvbn/thefuck.git
synced 2025-09-20 20:22:41 +01:00
#N/A Add gulp_not_task
rule
This commit is contained in:
28
tests/rules/test_gulp_not_task.py
Normal file
28
tests/rules/test_gulp_not_task.py
Normal file
@@ -0,0 +1,28 @@
|
||||
import pytest
|
||||
from tests.utils import Command
|
||||
from thefuck.rules.gulp_not_task import match, get_new_command
|
||||
|
||||
|
||||
def stdout(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
|
||||
'''.format(task)
|
||||
|
||||
|
||||
def test_match():
|
||||
assert match(Command('gulp srve', stdout('srve')), None)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('script, stdout', [
|
||||
('gulp serve', ''),
|
||||
('cat srve', stdout('srve'))])
|
||||
def test_not_march(script, stdout):
|
||||
assert not match(Command(script, stdout), None)
|
||||
|
||||
|
||||
def test_get_new_command(mocker):
|
||||
mocker.patch('thefuck.rules.gulp_not_task.get_gulp_tasks', return_value=[
|
||||
'serve', 'build', 'default'])
|
||||
command = Command('gulp srve', stdout('srve'))
|
||||
assert get_new_command(command, None) == 'gulp serve'
|
Reference in New Issue
Block a user