mirror of
https://github.com/nvbn/thefuck.git
synced 2025-10-30 06:34:09 +00:00
refact(shells): use an env var TF_ALIAS to keep the name of the alias
This environment variable may be used by any rule to decide whether it matches or not.
This commit is contained in:
@@ -33,6 +33,11 @@ class TestGeneric(object):
|
||||
def test_get_aliases(self, shell):
|
||||
assert shell.get_aliases() == {}
|
||||
|
||||
def test_app_alias(self, shell):
|
||||
assert 'alias fuck' in shell.app_alias()
|
||||
assert 'thefuck' in shell.app_alias()
|
||||
assert 'TF_ALIAS' in shell.app_alias()
|
||||
|
||||
|
||||
@pytest.mark.usefixtures('isfile')
|
||||
class TestBash(object):
|
||||
@@ -75,6 +80,11 @@ class TestBash(object):
|
||||
'la': 'ls -A',
|
||||
'll': 'ls -alF'}
|
||||
|
||||
def test_app_alias(self, shell):
|
||||
assert 'alias fuck' in shell.app_alias()
|
||||
assert 'thefuck' in shell.app_alias()
|
||||
assert 'TF_ALIAS' in shell.app_alias()
|
||||
|
||||
|
||||
@pytest.mark.usefixtures('isfile')
|
||||
class TestFish(object):
|
||||
@@ -124,6 +134,11 @@ class TestFish(object):
|
||||
'll': 'll',
|
||||
'math': 'math'}
|
||||
|
||||
def test_app_alias(self, shell):
|
||||
assert 'function fuck' in shell.app_alias()
|
||||
assert 'thefuck' in shell.app_alias()
|
||||
assert 'TF_ALIAS' in shell.app_alias()
|
||||
|
||||
|
||||
@pytest.mark.usefixtures('isfile')
|
||||
class TestZsh(object):
|
||||
@@ -167,3 +182,8 @@ class TestZsh(object):
|
||||
'l': 'ls -CF',
|
||||
'la': 'ls -A',
|
||||
'll': 'ls -alF'}
|
||||
|
||||
def test_app_alias(self, shell):
|
||||
assert 'alias fuck' in shell.app_alias()
|
||||
assert 'thefuck' in shell.app_alias()
|
||||
assert 'TF_ALIAS' in shell.app_alias()
|
||||
|
||||
Reference in New Issue
Block a user