def METHOD_NAME(cli_runner):
    completion_path: Path = Path.home() / ".zshrc"
    text = ""
    if not completion_path.is_file():
        completion_path.write_text('echo "custom .zshrc"')
    if completion_path.is_file():
        text = completion_path.read_text()
    r = cli_runner.invoke(["install", "tab-completion", "--shell", "zsh"])
    new_text = completion_path.read_text()
    completion_path.write_text(text)
    zfunc_fragment = "fpath+=~/.zfunc"
    assert zfunc_fragment in new_text
    assert "completion installed in" in r.stdout
    assert "Completion will take effect once you restart the terminal" in r.stdout
    install_source_path = Path.home() / os.path.join(".zfunc", "_kart")
    assert install_source_path.is_file()
    install_content = install_source_path.read_text()
    install_source_path.unlink()
    assert "compdef _kart_completion kart" in install_content