1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-07-14 19:13:32 +01:00
Files
tests
functional
rules
__init__.py
test_apt_get.py
test_apt_get_search.py
test_apt_invalid_operation.py
test_aws_cli.py
test_brew_install.py
test_brew_link.py
test_brew_uninstall.py
test_brew_unknown_command.py
test_brew_update_formula.py
test_brew_upgrade.py
test_cargo_no_command.py
test_cd_mkdir.py
test_cd_parent.py
test_chmod_x.py
test_composer_not_command.py
test_cp_omitting_directory.py
test_dirty_untar.py
test_dirty_unzip.py
test_django_south_ghost.py
test_django_south_merge.py
test_docker_not_command.py
test_dry.py
test_fab_command_not_found.py
test_fix_alt_space.py
test_fix_file.py
test_git_add.py
test_git_bisect_usage.py
test_git_branch_delete.py
test_git_branch_exists.py
test_git_branch_list.py
test_git_checkout.py
test_git_diff_no_index.py
test_git_diff_staged.py
test_git_fix_stash.py
test_git_help_aliased.py
test_git_not_command.py
test_git_pull.py
test_git_pull_clone.py
test_git_pull_uncommitted_changes.py
test_git_pull_unstaged_changes.py
test_git_push.py
test_git_push_force.py
test_git_push_pull.py
test_git_rebase_no_changes.py
test_git_remote_seturl_add.py
test_git_rm_recursive.py
test_git_stash.py
test_git_two_dashes.py
test_go_run.py
test_gradle_not_task.py
test_gradle_wrapper.py
test_grep_arguments_order.py
test_grep_recursive.py
test_grunt_task_not_found.py
test_gulp_not_task.py
test_has_exists_script.py
test_heroku_not_command.py
test_history.py
test_java.py
test_javac.py
test_lein_not_task.py
test_ln_no_hard_link.py
test_ln_s_order.py
test_ls_lah.py
test_man.py
test_man_no_space.py
test_mercurial.py
test_mkdir_p.py
test_mvn_no_command.py
test_mvn_unknown_lifecycle_phase.py
test_no_command.py
test_no_such_file.py
test_npm_missing_script.py
test_npm_run_script.py
test_npm_wrong_command.py
test_open.py
test_pacman.py
test_pacman_not_found.py
test_pip_unknown_command.py
test_port_already_in_use.py
test_python_command.py
test_python_execute.py
test_quotation_marks.py
test_react_native_command_unrecognized.py
test_remove_trailing_cedilla.py
test_rm_dir.py
test_rm_root.py
test_sed_unterminated_s.py
test_sl_ls.py
test_ssh_known_host.py
test_sudo.py
test_switch_lang.py
test_systemctl.py
test_tmux.py
test_touch.py
test_tsuru_login.py
test_tsuru_not_command.py
test_unknown_command.py
test_vagrant_up.py
test_whois.py
test_workon_doesnt_exists.py
shells
specific
__init__.py
conftest.py
test_conf.py
test_corrector.py
test_logs.py
test_readme.py
test_types.py
test_ui.py
test_utils.py
utils.py
thefuck
.gitignore
.travis.yml
CONTRIBUTING.md
LICENSE.md
MANIFEST.in
README.md
appveyor.yml
example.gif
install.sh
release.py
requirements.txt
setup.cfg
setup.py
tox.ini
thefuck/tests/rules/test_git_diff_no_index.py
Joseph Frazier 2b88ea11ea Suggest git diff --no-index when relevant
This makes it easier to use `git diff` on untracked files.
2016-10-03 00:05:01 -04:00

24 lines
695 B
Python

import pytest
from thefuck.rules.git_diff_no_index import match, get_new_command
from tests.utils import Command
@pytest.mark.parametrize('command', [
Command(script='git diff foo bar')])
def test_match(command):
assert match(command)
@pytest.mark.parametrize('command', [
Command(script='git diff --no-index foo bar'),
Command(script='git diff foo'),
Command(script='git diff foo bar baz')])
def test_not_match(command):
assert not match(command)
@pytest.mark.parametrize('command, new_command', [
(Command('git diff foo bar'), 'git diff --no-index foo bar')])
def test_get_new_command(command, new_command):
assert get_new_command(command) == new_command