Created
February 23, 2010 15:56
-
-
Save MrJaba/312331 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/bash | |
function rtest | |
{ | |
ignore=${1:?'file not set'} | |
#locate test file name(s) | |
local test_file | |
local test_type | |
#are they unit / functionals? | |
#run rake test with appropriate options | |
for file_name in "$@"; do | |
test_file=`find . -name $file_name\*_test.rb` | |
echo $test_file | |
#find type of test | |
test_type=`echo $test_file | egrep "(unit|functional)" -o` | |
echo "rake test:${test_type}s TEST=\"$test_file\" TESTOPTS=\"-v\"" | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment