Created
November 1, 2011 03:12
-
-
Save quad/1329756 to your computer and use it in GitHub Desktop.
YO DAWG I HERD U LIKE ORDER-DEPENDENT TESTS?
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/sh | |
# | |
# YO DAWG I HERD U LIKE ORDER-DEPENDENT TESTS? | |
# | |
# SO I PUT ORDER-DEPENDENT EXAMPLES N UR ORDER-DEPENDENT SPECS | |
# SO U CAN B NON-DETERMINISTIC WHILE UR NON-DETERMINISTIC | |
# | |
# http://memegenerator.net/instance/11059517 | |
function die () { | |
echo "$0: $@" >&2 && | |
exit 1 | |
} | |
function purge () { | |
rm $@ || true | |
} | |
DEV_DB=db/development.sqlite3 | |
TEST_DB=db/test.sqlite3 | |
SPECS=$(find test -name '*_spec.rb') | |
purge $DEV_DB && | |
purge tmp/last_db_rebuild.touch && | |
bin/rake db:rebuild >&2 || die "Could not rebuild the development database" | |
for s in $SPECS; do | |
purge $TEST_DB && | |
bin/rake db:test:prepare >&2 || | |
die "Could not prepare the test database" | |
bin/spec $s >&2 || echo $s | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
First revision of the find-fucked-tests script finds– via brute force– specs that are order-dependent.
Next up, per-example runs.