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

feat(shells): add specific actions for the Fish shell

Signed-off-by: Pablo Santiago Blum de Aguiar <scorphus@gmail.com>
This commit is contained in:
Pablo Santiago Blum de Aguiar
2015-05-08 20:09:50 -03:00
parent 8d256390a1
commit 1b5c935f30
2 changed files with 48 additions and 0 deletions

View File

@@ -50,6 +50,28 @@ class TestBash(object):
write.assert_called_once_with('ls\n')
@pytest.mark.usefixtures('isfile')
class TestFish(object):
@pytest.mark.parametrize('before, after', [
('pwd', 'pwd'),
('ll', 'll')]) # Fish has no aliases but functions
def test_from_shell(self, before, after):
assert shells.Fish().from_shell(before) == after
def test_to_shell(self):
assert shells.Fish().to_shell('pwd') == 'pwd'
def test_put_to_history(self, builtins_open, mocker):
mocker.patch('thefuck.shells.time',
return_value=1430707243.3517463)
shells.Fish().put_to_history('ls')
builtins_open.return_value.__enter__.return_value. \
write.assert_called_once_with('- cmd: ls\n when: 1430707243\n')
def test_and_(self):
assert shells.Fish().and_('foo', 'bar') == 'foo; and bar'
@pytest.mark.usefixtures('isfile')
class TestZsh(object):
@pytest.fixture(autouse=True)