mirror of
https://github.com/nvbn/thefuck.git
synced 2025-10-08 12:53:58 +01:00
#579: Ignore commands of len 1 in missing_space_before_subcommand
This commit is contained in:
committed by
Pablo Aguiar
parent
8bebce331e
commit
7f3442747e
@@ -8,11 +8,11 @@ from thefuck.types import Command
|
||||
def all_executables(mocker):
|
||||
return mocker.patch(
|
||||
'thefuck.rules.missing_space_before_subcommand.get_all_executables',
|
||||
return_value=['git', 'ls', 'npm'])
|
||||
return_value=['git', 'ls', 'npm', 'w', 'watch'])
|
||||
|
||||
|
||||
@pytest.mark.parametrize('script', [
|
||||
'gitbranch', 'ls-la', 'npminstall'])
|
||||
'gitbranch', 'ls-la', 'npminstall', 'watchls'])
|
||||
def test_match(script):
|
||||
assert match(Command(script, ''))
|
||||
|
||||
@@ -25,6 +25,7 @@ def test_not_match(script):
|
||||
@pytest.mark.parametrize('script, result', [
|
||||
('gitbranch', 'git branch'),
|
||||
('ls-la', 'ls -la'),
|
||||
('npminstall webpack', 'npm install webpack')])
|
||||
('npminstall webpack', 'npm install webpack'),
|
||||
('watchls', 'watch ls')])
|
||||
def test_get_new_command(script, result):
|
||||
assert get_new_command(Command(script, '')) == result
|
||||
|
Reference in New Issue
Block a user