mirror of
https://github.com/nvbn/thefuck.git
synced 2025-09-20 20:22:41 +01:00
refact(man): do not match if there's no argument to man
If there's no argument to man, a call to thefuck should just give no fuck. Signed-off-by: Pablo Santiago Blum de Aguiar <scorphus@gmail.com>
This commit is contained in:
@@ -2,6 +2,7 @@ import pytest
|
||||
from thefuck.rules.man import match, get_new_command
|
||||
from tests.utils import Command
|
||||
|
||||
|
||||
@pytest.mark.parametrize('command', [
|
||||
Command('man read'),
|
||||
Command('man 2 read'),
|
||||
@@ -14,6 +15,13 @@ def test_match(command):
|
||||
assert match(command, None)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('command', [
|
||||
Command('man'),
|
||||
Command('man ')])
|
||||
def test_not_match(command):
|
||||
assert not match(command, None)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('command, new_command', [
|
||||
(Command('man read'), 'man 3 read'),
|
||||
(Command('man 2 read'), 'man 3 read'),
|
||||
|
Reference in New Issue
Block a user