diff --git a/tests/rules/test_man.py b/tests/rules/test_man.py index b2e7f281..883d7366 100644 --- a/tests/rules/test_man.py +++ b/tests/rules/test_man.py @@ -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'), diff --git a/thefuck/rules/man.py b/thefuck/rules/man.py index 13ff0c6a..0b15c5fc 100644 --- a/thefuck/rules/man.py +++ b/thefuck/rules/man.py @@ -1,5 +1,5 @@ def match(command, settings): - return command.script.startswith('man') + return command.script.strip().startswith('man ') def get_new_command(command, settings):