Skip to content

Instantly share code, notes, and snippets.

@dcadenas
Created October 2, 2009 04:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcadenas/199452 to your computer and use it in GitHub Desktop.
Save dcadenas/199452 to your computer and use it in GitHub Desktop.
Bash script to filter tests by keyword
#!/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