Created
January 14, 2014 20:14
-
-
Save ledbettj/8424836 to your computer and use it in GitHub Desktop.
find files in app or lib which don't have matching specs in spec/
This file contains hidden or 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
| #!/usr/bin/env bash | |
| TOTAL=0 | |
| MISSING=0 | |
| for file in $(find lib app -name "*.rb"); do | |
| BASE=$(dirname $file | sed s/app\\///); # no app folder in spec dir | |
| SPEC="spec/$BASE/$(basename $file .rb)_spec.rb" | |
| if [ ! -f "$SPEC" ]; then | |
| echo -ne "$(tput setaf 1)" | |
| let MISSING=MISSING+1 | |
| else | |
| echo -n "$(tput setaf 2)" | |
| fi | |
| echo "⬢ $(tput sgr0)$SPEC" | |
| let TOTAL=TOTAL+1 | |
| done | |
| echo "Missing $MISSING/$TOTAL files checked." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment