Last active
August 29, 2015 14:14
-
-
Save nmeylan/54a84fd2a8c37bb30b53 to your computer and use it in GitHub Desktop.
Command line : Run rake test for the given file and/or given method
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/sh | |
if [ $# -eq 0 ]; then | |
echo "Please provide arguments at least 1 argument. You use the command as following" | |
echo "sptest test_file" | |
echo "sptest test_file test_case" | |
else | |
if [ $# -eq 2 ]; then | |
test_case=$2 | |
test_case=${test_case// /_} | |
if ! [[ "$test_case" =~ ^test_.* ]]; then | |
test_case="test_"$test_case | |
fi | |
time spring rake test TEST=$1 TESTOPTS="--name=$test_case" | |
else | |
time spring rake test TEST=$1 | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment