I\'ve been using Clojure for a little while and want to create some projects that are bigger and more complicated than toys. I\'ve been using Java for the past few years and hav
With Eclipse, you can have unit tests (or any program) run every time you save a file in the project. The whole process takes less than a second -- it's great for test-driven development, and removes the need for cut-and-paste into the REPL for most situations. Plus you get to keep the tests! :-)
You'll want to use cake to avoid the JVM startup time every time you launch your tests. You can run cake test on the command line, or just have Eclipse run it for you when you save any file in your project.
I got this to work by setting up a project with Leiningen, installing cake, and installing the counterclockwise Eclipse plugin. To set up Eclipse to run tests every time you save, select Project->Properties->Builders, click New, select Program, call it something like 'run tests', add the path to cake under Location, select the Working Directory for your project, and add test to the optional arguments. Under the 'Build Options' tab, select 'During Auto Builds.'
I got the general idea for this from Jeff Younker's book, "Foundations of Agile Python Development." Been an Emacs man for 20 years, but this trick has put Eclipse at the front of my workflow lately.
Update: roughly one year later, I now use Midje with the lazytest option to do the same thing while developing with both Emacs and Eclipse.