Skip to content

Instantly share code, notes, and snippets.

@nmeylan
Last active August 29, 2015 14:14
Show Gist options
  • Save nmeylan/54a84fd2a8c37bb30b53 to your computer and use it in GitHub Desktop.
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
#!/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