O'Reilly logo

Clojure Web Development Essentials by Ryan Baldwin

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

Writing and running our first test

We're going to create a few tests for the validators we created in Chapter 5, Handling Form Input. In our directory structure, we have the src and test directories. I'll give you two seconds to determine under which directory our tests should go… got it? If you said src, then I have failed to achieve the modest task that was my charge. We will be storing our tests in the test directory using the following steps:

  1. Create a directory in the /test/hisptr/test directory called validators.
  2. Create a file in the /text/hipstr/test/validators directory called user_validator_test.clj.
  3. In user_validator_test.clj, define our namespace and include the clojure.test namespace and the namespace we wish to test—in our case, the ...

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