From 2a7cbef3b5e364fa6da4850178b06ed85bb5304c Mon Sep 17 00:00:00 2001 From: SanketDG Date: Tue, 21 Apr 2015 23:41:49 +0530 Subject: [PATCH] add tests for cd_parent --- tests/rules/test_cd_parent.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/rules/test_cd_parent.py diff --git a/tests/rules/test_cd_parent.py b/tests/rules/test_cd_parent.py new file mode 100644 index 00000000..7a0fbc8b --- /dev/null +++ b/tests/rules/test_cd_parent.py @@ -0,0 +1,12 @@ +from thefuck.main import Command +from thefuck.rules.cd_parent import match, get_new_command + + +def test_match(): + assert match(Command('cd..', '', 'cd..: command not found'), None) + assert not match(Command('', '', ''), None) + + +def test_get_new_command(): + assert get_new_command( + Command('cd..', '', ''), None) == 'cd ..'