Dropping this into lib/tasks/test_wip.rake will add rails test:diff command. This runs certain tests that relate to your changes. In particular, the following tests are picked:
- modified* test files
- test files for modified model/controller/job/mailer/helper files (e.g. if
app/models/user.rbhas changed,test/models/user_test.rbis picked) - test files for controllers/mailers whose views have been modified
*modified file is a file that is either git modifed or appears in git diff master
The quality of the result relies on how well you stick to the rails conventions. E.g., changes in app/models/user.rb won't trigger app/models/account_test.rb, if that's where your user models tests happens to reside.