Last active
March 31, 2017 16:43
-
-
Save benjaminoakes/3b631b67848f9f187269a5811ec930e8 to your computer and use it in GitHub Desktop.
Rails: Run Changed Tests
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
#!/bin/sh | |
extant_files="" | |
for file in $(git diff --name-only master . | grep '^test' | grep -v '^test/factories' | grep -v '^test/support'); do | |
if [ -f "$file" ]; then | |
extant_files="$extant_files $file" | |
fi | |
done | |
set -x | |
# Or whatever commmand you use to test, e.g. `ruby -I test path/to/test.rb` | |
zeus test $extant_files |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment