Created
October 2, 2009 04:05
-
-
Save dcadenas/199452 to your computer and use it in GitHub Desktop.
Bash script to filter tests by keyword
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/bash | |
if [ -n "$1" ] | |
then | |
filter=$1 | |
else | |
echo "Usage: run_tests filtering_keyword" | |
exit | |
fi | |
spec_files=$(grep -rl "$1" spec |egrep "_spec.rb$") | |
echo "Only the following files will be included in this test run because they include the text '$1':" | |
echo "$spec_files" | |
echo | |
script/spec $spec_files |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment