Created
August 22, 2012 12:42
-
-
Save joequery/3425222 to your computer and use it in GitHub Desktop.
Ghetto Autotest
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 | |
| # Our ghetto auto-testish thing. User presses any key to test, | |
| # Ctrl-C to get out. Make this file executable, place in your path, and run in | |
| # your Ruby project's directory. Assumes your tests are located in spec/ | |
| # Technically 100% more convenient than up+enter! ;) | |
| function hold(){ | |
| read -n 1 -s | |
| } | |
| function do_test(){ | |
| printf "\nTesting..." | |
| # If no arguments passed, look for the spec directory | |
| # Otherwise, just run the tests where specified. | |
| if [ $# -gt 0 ] | |
| then | |
| bundle exec rspec -f nested --drb $@ | |
| else | |
| find spec/* -name *.rb | xargs bundle exec rspec -f nested --drb | |
| fi | |
| printf "\nPress any key to test... \n" | |
| hold | |
| do_test $@ | |
| } | |
| do_test $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment