mirror of
https://github.com/nvbn/thefuck.git
synced 2025-01-18 20:11:17 +00:00
naming
This commit is contained in:
parent
cc5ee9caae
commit
53704658b2
@ -2,14 +2,14 @@ import pytest
|
||||
from thefuck.rules.rbenv_install import match, get_new_command
|
||||
from thefuck.types import Command
|
||||
|
||||
expected_new_command = """cd /home/alex/.rbenv/plugins/ruby-build && git pull && cd -"""
|
||||
expected_actual_command = """cd /home/alex/.rbenv/plugins/ruby-build && git pull && cd -"""
|
||||
expected_output = """ruby-build: definition not found: 2.6.1
|
||||
|
||||
See all available versions with `rbenv install --list'.
|
||||
|
||||
If the version you need is missing, try upgrading ruby-build:
|
||||
|
||||
%s""" % expected_new_command
|
||||
%s""" % expected_actual_command
|
||||
|
||||
|
||||
@pytest.mark.parametrize('script, output', [
|
||||
@ -20,6 +20,6 @@ def test_match(script, output):
|
||||
|
||||
|
||||
@pytest.mark.parametrize('command, new_command', [
|
||||
(Command('rbenv install 2.6.1', expected_output), expected_new_command)])
|
||||
(Command('rbenv install 2.6.1', expected_output), expected_actual_command)])
|
||||
def test_get_new_command(command, new_command):
|
||||
assert get_new_command(command) == new_command
|
||||
|
@ -10,5 +10,5 @@ def match(command):
|
||||
|
||||
|
||||
def get_new_command(command):
|
||||
output = command.output.split('\n')[-1].lstrip()
|
||||
return shell.to_shell(output)
|
||||
actualCommand = command.output.split('\n')[-1].lstrip()
|
||||
return shell.to_shell(actualCommand)
|
||||
|
Loading…
x
Reference in New Issue
Block a user