Just run rspec tests that differ from master
Imagine you started a branch and you would not test everything before you are done, you are just interested in the tests you added or modified. The following piece of code runs rspec just for these files.
git diff --name-only --diff-filter=AMR origin/master | grep _spec.rb | xargs rspec
... make an alias ...
echo "alias mspec='git diff --name-only --diff-filter=AMR origin/master | grep _spec.rb | xargs rspec'" >> ~/.bashrc
... and whenever you are working in a branch, you can just type mspec
to run your modified tests.
Written by Markus Graf
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#