Skip to content

Instantly share code, notes, and snippets.

@MrJaba
Created February 23, 2010 15:56
Show Gist options
  • Save MrJaba/312331 to your computer and use it in GitHub Desktop.
Save MrJaba/312331 to your computer and use it in GitHub Desktop.
#!/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