1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-21 10:08:59 +00:00
thefuck/tests/rules/test_rbenv_install.py
2019-08-30 14:50:06 +03:00

27 lines
823 B
Python

import pytest
from thefuck.rules.rbenv_install import match, get_new_command
from thefuck.types import Command
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_actual_command
@pytest.mark.parametrize('script, output', [
('rbenv install 2.6.1', expected_output)
])
def test_match(script, output):
assert match(Command(script, output))
@pytest.mark.parametrize('command, 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