pre-commit: improve test (#21443)

Now covers:
- `PYTHONPATH` based setup
- relative virtualenv symlinks
This commit is contained in:
Anthony Sottile 2017-12-08 11:34:51 -08:00 committed by ilovezfs
parent ee0ac4f97f
commit ccbb24b753

View file

@ -47,7 +47,16 @@ class PreCommit < Formula
- id: trailing-whitespace
EOS
system bin/"pre-commit", "install"
system bin/"pre-commit", "run", "--all-files"
(testpath/"f").write "hi\n"
system "git", "add", "f"
ENV["GIT_AUTHOR_NAME"] = "test user"
ENV["GIT_AUTHOR_EMAIL"] = "test@example.com"
ENV["GIT_COMMITTER_NAME"] = "test user"
ENV["GIT_COMMITTER_EMAIL"] = "test@example.com"
git_exe = which("git")
ENV["PATH"] = "/usr/bin:/bin"
system git_exe, "commit", "-m", "test"
end
end
end