The easiest way to run the tests after cloning down rails and bundling is to use rake.
in the root rails folder will run all the available tests, this is great but when working on something also not what I want most of the time. But running it in a subfolder like activesupport will actually do the right thing and run only this subset of tests
$ cd activesupport
$ bundle exec rake test
To make this easier I’m using textmate.el to execute most commands while inside a project from the determined project-root. Meaning if I switch to a file I set the working directory to the current root automatically.
(defun coder/default-project-dir ()
(if (textmate-project-root)
(setq default-directory (textmate-project-root))))
(add-hook 'find-file-hook 'coder/default-project-dir)
Adding .emacs-project files to all the subdirectories will now make sure that when I run a rake command it will be run in the correct directory. Combining this with rake.el allows to run test via a simple M-x rake and selecting test, M-x rake-rerun will now rerun the given tests with a simple command.
This works great while working in quick running test suites but running the whole suite on every change can become inconvenient quickly, this is solved by 2 more enhancements to the flow