Last active
June 29, 2016 03:15
-
-
Save kukat/f3fcd2a0bc0a216169f489aeead4eb1c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
files=$(git diff HEAD --name-only --diff-filter=ACMR -- apps/realestate/test/**Spec.swift) | |
pass=true | |
fits="" | |
if [ "$files" != "" ]; then | |
echo "Checking 'fit', 'fcontext' and 'fdescribe' in unit tests..." | |
echo "" | |
for file in ${files}; do | |
fits=$(grep -nE '^\s*f(it|context|describe)' ${file}) | |
if [ "$fits" != "" ]; then | |
echo "${file}" | |
echo "${fits}" | |
echo "" | |
pass=false | |
fi | |
done | |
fi | |
if $pass; then | |
exit 0; | |
else | |
echo "----------------------------------------------" | |
echo "COMMIT FAILED:" | |
echo "You cannot commit test cases with temporary focused examples 'fit', 'fcontext' and 'fdescribe'." | |
exit 1; | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
今天写测试被
fit
坑了一把,什么是 fit