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 ..'