Last active
June 15, 2023 09:25
-
-
Save Lockyy/e4b1de7b0a4872423e4431bcd7dd957e to your computer and use it in GitHub Desktop.
Uses files-diff to retrieve a list of changed files and then filters it down to runnable specs then runs 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
#!/bin/bash | |
changedSpecFiles=$(files-diff | grep '^spec' | grep -v 'spec/support' | grep -v 'spec/factories') | |
joinedSpecFileNames=$($changedSpecFiles | tr "\n" " ") | |
spring rspec "$@" $($joinedSpecFileNames) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I should probably update this so that it just hunts for anything ending in _spec.rb rather than trying to exclude specific folders.