1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-10-30 22:54:14 +00:00

refact(shells): add support to Fish functions

Signed-off-by: Pablo Santiago Blum de Aguiar <scorphus@gmail.com>
This commit is contained in:
Pablo Santiago Blum de Aguiar
2015-05-21 23:55:49 -03:00
parent 2bebfabf8d
commit 551e35e3b6
2 changed files with 18 additions and 1 deletions

View File

@@ -78,6 +78,12 @@ class TestFish(object):
def shell(self):
return shells.Fish()
@pytest.fixture(autouse=True)
def Popen(self, mocker):
mock = mocker.patch('thefuck.shells.Popen')
mock.return_value.stdout.read.return_value = (b'funced\nfuncsave\ngrep')
return mock
@pytest.mark.parametrize('before, after', [
('pwd', 'pwd'),
('ll', 'll')]) # Fish has no aliases but functions
@@ -98,7 +104,9 @@ class TestFish(object):
assert shell.and_('foo', 'bar') == 'foo; and bar'
def test_get_aliases(self, shell):
assert shell.get_aliases() == {}
assert shell.get_aliases() == {'funced': 'funced',
'funcsave': 'funcsave',
'grep': 'grep'}
@pytest.mark.usefixtures('isfile')