O'Reilly logo

Clojure Applied by Alex Miller, Ben Vandgrift

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Organizing and Running Your Tests

The most common way to structure Clojure projects is to have two source directories—one for source code and another for tests. Most Clojure tools automatically create and understand projects with this structure.

Tests are commonly stored in a namespace parallel to the namespace being tested, as in this example structure:

 
myproj
 
├── src
 
│ └── proj
 
│ └── util
 
│ └── string.clj
 
└── test
 
└── proj
 
└── util
 
└── test_string.clj

If we store our string utility functions in the proj.util.string namespace under the src/ directory, the associated tests are stored in a similarly named namespace under the sibling test/ directory. The tests will be available on the classpath when we run tests but will generally ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required