2015-04-18 23:19:34 +02:00
|
|
|
import pytest
|
|
|
|
from thefuck.rules.lein_not_task import match, get_new_command
|
2015-08-27 16:42:09 +03:00
|
|
|
from tests.utils import Command
|
2015-04-18 23:19:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
def is_not_task():
|
|
|
|
return ''''rpl' is not a task. See 'lein help'.
|
|
|
|
|
|
|
|
Did you mean this?
|
|
|
|
repl
|
2015-07-29 16:09:26 +03:00
|
|
|
jar
|
2015-04-18 23:19:34 +02:00
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
|
|
def test_match(is_not_task):
|
2015-09-07 13:00:29 +03:00
|
|
|
assert match(Command(script='lein rpl', stderr=is_not_task))
|
|
|
|
assert not match(Command(script='ls', stderr=is_not_task))
|
2015-04-18 23:19:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
def test_get_new_command(is_not_task):
|
2016-10-06 14:51:22 -04:00
|
|
|
assert (get_new_command(Command(script='lein rpl --help', stderr=is_not_task))
|
|
|
|
== ['lein repl --help', 'lein jar --help'])
|