Created
March 26, 2011 21:41
-
-
Save garybernhardt/888666 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
set -e | |
if [ $# -gt 0 ]; then # we have args | |
filename=$1 | |
(set +e; grep -r 'spec_helper' $filename) > /dev/null | |
if [ $? -eq 1 ]; then # no match; we have a stand-alone spec | |
standalone_spec=1 | |
fi | |
else # we have no args | |
filename='spec' | |
fi | |
command='rspec' | |
if [ ! $standalone_spec ]; then | |
command="ruby -S bundle exec $command" | |
fi | |
RAILS_ENV=test $command $filename |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment