Last active
July 27, 2021 12:15
-
-
Save blocknotes/c649b0c02c2428c6e2eaebdc0def1c5b to your computer and use it in GitHub Desktop.
Find specs in a commits range - Execute them
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
# All specs in the diff commits from develop (useful to check a specific branch): | |
git diff-tree --no-commit-id --name-only -r develop..HEAD | grep '_spec\.rb' | sort | uniq > /tmp/specs | |
# All specs in a specific range of commits: | |
git diff-tree --no-commit-id --name-only -r HEAD~3..HEAD | grep '_spec\.rb' | sort | uniq > /tmp/specs | |
# Execute them: | |
while read p; do; if [ -f "$p" ]; then; be rspec "$p" || break; fi; done </tmp/specs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment