Runs rspec tests in subdirectories
You can pass an optional filter to filter out directories in which you don't want to run tests
#!/usr/bin/env zsh
source "$HOME/.rvm/scripts/rvm" 2>&1 >/dev/null
o=$(pwd)
filter=$1
if [[ -z $filter ]]; then
filter=""
fi
for d in $(find . -name spec -type d | egrep "$filter" | replace spec ' ' )
do
cd $d 2>/dev/null
echo "$d -------------------------------"
git status -s -b
RACK_ENV=test bundle exec rspec -f n -c 2>/dev/null | egrep " examples.*failu"
echo "\n"
cd $o
done
Written by Łukasz Korecki
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#