diff --git a/tests/rules/test_goenv_no_such_command.py b/tests/rules/test_goenv_no_such_command.py index 9cce8b05..0f63a9d2 100644 --- a/tests/rules/test_goenv_no_such_command.py +++ b/tests/rules/test_goenv_no_such_command.py @@ -1,6 +1,6 @@ import pytest -from thefuck.rules.goenv_no_such_command import match +from thefuck.rules.goenv_no_such_command import get_new_command, match from thefuck.types import Command @@ -25,3 +25,13 @@ def test_match(script, goenv_cmd, output): ]) def test_not_match(script, output): assert not match(Command(script, output=output)) + + +@pytest.mark.parametrize('script, goenv_cmd, result', [ + ('goenv globe', 'globe', 'goenv global'), + ('goenv intall 3.8.0', 'intall', 'goenv install 3.8.0'), + ('goenv list', 'list', 'goenv install --list'), + ('goenv remove 3.8.0', 'remove', 'goenv uninstall 3.8.0'), +]) +def test_get_new_command(script, goenv_cmd, output, result): + assert result in get_new_command(Command(script, output)) diff --git a/tests/rules/test_nodenv_no_such_command.py b/tests/rules/test_nodenv_no_such_command.py index 7076ee48..7d95d925 100644 --- a/tests/rules/test_nodenv_no_such_command.py +++ b/tests/rules/test_nodenv_no_such_command.py @@ -1,6 +1,6 @@ import pytest -from thefuck.rules.nodenv_no_such_command import match +from thefuck.rules.nodenv_no_such_command import get_new_command, match from thefuck.types import Command @@ -25,3 +25,13 @@ def test_match(script, nodenv_cmd, output): ]) def test_not_match(script, output): assert not match(Command(script, output=output)) + + +@pytest.mark.parametrize('script, nodenv_cmd, result', [ + ('nodenv globe', 'globe', 'nodenv global'), + ('nodenv intall 3.8.0', 'intall', 'nodenv install 3.8.0'), + ('nodenv list', 'list', 'nodenv install --list'), + ('nodenv remove 3.8.0', 'remove', 'nodenv uninstall 3.8.0'), +]) +def test_get_new_command(script, nodenv_cmd, output, result): + assert result in get_new_command(Command(script, output)) diff --git a/tests/rules/test_pyenv_no_such_command.py b/tests/rules/test_pyenv_no_such_command.py index 926730da..8d73a5ca 100644 --- a/tests/rules/test_pyenv_no_such_command.py +++ b/tests/rules/test_pyenv_no_such_command.py @@ -1,6 +1,6 @@ import pytest -from thefuck.rules.pyenv_no_such_command import match +from thefuck.rules.pyenv_no_such_command import get_new_command, match from thefuck.types import Command @@ -25,3 +25,13 @@ def test_match(script, pyenv_cmd, output): ]) def test_not_match(script, output): assert not match(Command(script, output=output)) + + +@pytest.mark.parametrize('script, pyenv_cmd, result', [ + ('pyenv globe', 'globe', 'pyenv global'), + ('pyenv intall 3.8.0', 'intall', 'pyenv install 3.8.0'), + ('pyenv list', 'list', 'pyenv install --list'), + ('pyenv remove 3.8.0', 'remove', 'pyenv uninstall 3.8.0'), +]) +def test_get_new_command(script, pyenv_cmd, output, result): + assert result in get_new_command(Command(script, output)) diff --git a/tests/rules/test_rbenv_no_such_command.py b/tests/rules/test_rbenv_no_such_command.py index 05e9be9f..05685380 100644 --- a/tests/rules/test_rbenv_no_such_command.py +++ b/tests/rules/test_rbenv_no_such_command.py @@ -1,6 +1,6 @@ import pytest -from thefuck.rules.rbenv_no_such_command import match +from thefuck.rules.rbenv_no_such_command import get_new_command, match from thefuck.types import Command @@ -25,3 +25,13 @@ def test_match(script, rbenv_cmd, output): ]) def test_not_match(script, output): assert not match(Command(script, output=output)) + + +@pytest.mark.parametrize('script, rbenv_cmd, result', [ + ('rbenv globe', 'globe', 'rbenv global'), + ('rbenv intall 3.8.0', 'intall', 'rbenv install 3.8.0'), + ('rbenv list', 'list', 'rbenv install --list'), + ('rbenv remove 3.8.0', 'remove', 'rbenv uninstall 3.8.0'), +]) +def test_get_new_command(script, rbenv_cmd, output, result): + assert result in get_new_command(Command(script, output))