May 2018
Beginner to intermediate
290 pages
6h 43m
English
While clojure.test is a fine implementation of traditional unit testing, it does suffer from the common drawback of all unit-testing frameworks. To test a given property of your code, you think of some examples that exercise that property and you start typing. The problem with this approach is that the tests are one step removed from the thing you’re really interested in: the property. For example, take another look at the first test we wrote in this chapter:
| | (deftest test-finding-books |
| | (is (not (nil? (i/find-by-title "Emma" books))))) |
A casual observer might be forgiven for thinking that this test has something to do with the novel Emma. It doesn’t. The test is trying to say that we should get a non-nil result when ...
Read now
Unlock full access