#/N/A: Extend pyenv rule to include goenv, nodenv and rbenv (#1100)
Co-authored-by: Pablo Santiago Blum de Aguiar <scorphus@gmail.com> Co-authored-by: Divy Jain <dkj@somaiya.edu>
This commit is contained in:
committed by
GitHub
parent
fd90e69ceb
commit
0e34c2343e
+7
-2
@@ -1,6 +1,6 @@
|
||||
import pytest
|
||||
|
||||
from thefuck.rules.pyenv_no_such_command import get_new_command, match
|
||||
from thefuck.rules.omnienv_no_such_command import get_new_command, match
|
||||
from thefuck.types import Command
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ def output(pyenv_cmd):
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def Popen(mocker):
|
||||
mock = mocker.patch('thefuck.rules.pyenv_no_such_command.Popen')
|
||||
mock = mocker.patch('thefuck.rules.omnienv_no_such_command.Popen')
|
||||
mock.return_value.stdout.readlines.return_value = (
|
||||
b'--version\nactivate\ncommands\ncompletions\ndeactivate\nexec_\n'
|
||||
b'global\nhelp\nhooks\ninit\ninstall\nlocal\nprefix_\n'
|
||||
@@ -33,6 +33,11 @@ def test_match(script, pyenv_cmd, output):
|
||||
assert match(Command(script, output=output))
|
||||
|
||||
|
||||
def test_match_goenv_output_quote():
|
||||
"""test goenv's specific output with quotes (')"""
|
||||
assert match(Command('goenv list', output="goenv: no such command 'list'"))
|
||||
|
||||
|
||||
@pytest.mark.parametrize('script, output', [
|
||||
('pyenv global', 'system'),
|
||||
('pyenv versions', ' 3.7.0\n 3.7.1\n* 3.7.2\n'),
|
||||
Reference in New Issue
Block a user