From ffa6bc2fde07781a70f964d6d4df3f1cd0b1dac3 Mon Sep 17 00:00:00 2001 From: Laurens Van Houtven <_@lvh.io> Date: Thu, 12 May 2016 09:06:58 -0500 Subject: [PATCH 1/3] Reflow slamhound section --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e3835f3..653b157 100644 --- a/README.md +++ b/README.md @@ -1631,13 +1631,12 @@ you need to comment out a particular form. There are some tools created by the Clojure community that might aid you in your endeavor to write idiomatic Clojure code. -* [Slamhound](https://github.com/technomancy/slamhound) is a tool that -will automatically generate proper `ns` declarations from your -existing code. * [kibit](https://github.com/jonase/kibit) is a static code analyzer for Clojure which uses [core.logic](https://github.com/clojure/core.logic) to search for patterns of code for which there might exist a more idiomatic +* [Slamhound](https://github.com/technomancy/slamhound) is a tool that will + automatically generate proper `ns` declarations from your existing code. function or macro. # Contributing From b76f79be7891684d5f0710a913f6b43a5c9e4f6d Mon Sep 17 00:00:00 2001 From: Laurens Van Houtven <_@lvh.io> Date: Thu, 12 May 2016 09:07:18 -0500 Subject: [PATCH 2/3] Reflow kibit section --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 653b157..20b2551 100644 --- a/README.md +++ b/README.md @@ -1631,12 +1631,12 @@ you need to comment out a particular form. There are some tools created by the Clojure community that might aid you in your endeavor to write idiomatic Clojure code. -* [kibit](https://github.com/jonase/kibit) is a static code analyzer - for Clojure which uses - [core.logic](https://github.com/clojure/core.logic) to search for - patterns of code for which there might exist a more idiomatic * [Slamhound](https://github.com/technomancy/slamhound) is a tool that will automatically generate proper `ns` declarations from your existing code. + +* [kibit](https://github.com/jonase/kibit) is a static code analyzer for + Clojure which uses [core.logic](https://github.com/clojure/core.logic) to + search for patterns of code for which there might exist a more idiomatic function or macro. # Contributing From c6da55e0f097b8075191b30e1045525bc085d4d5 Mon Sep 17 00:00:00 2001 From: Laurens Van Houtven <_@lvh.io> Date: Thu, 12 May 2016 09:14:20 -0500 Subject: [PATCH 3/3] Add a section on test naming Closes #131. --- README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/README.md b/README.md index 20b2551..6a07c5e 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ Translations of the guide are available in the following languages: * [Comment Annotations](#comment-annotations) * [Existential](#existential) * [Tooling](#tooling) +* [Testing](#Testing) ## Source Code Layout & Organization @@ -1639,6 +1640,36 @@ in your endeavor to write idiomatic Clojure code. search for patterns of code for which there might exist a more idiomatic function or macro. +## Testing + + * + Store your tests in a separate directory, typically `test/yourproject/` (as + opposed to `src/yourproject/`). Your build tool is responsible for making + them available in the contexts where they are necessary; most templates + will do this for you automatically. + [[link](#test-directory-structure)] + + * + Name your ns `yourproject.something-test`, a file which usually lives in + `test/yourproject/something_test.clj` (or `.cljc`, `cljs`). + [[link](#test-ns-naming)] + + * When using `clojure.test`, define your tests + with `deftest` and name them `something-test`. For example: + + ```clojure + ;; good + (deftest something-test ...) + + ;; bad + (deftest something-tests ...) + (deftest test-something ...) + (deftest something ...) + ``` + + [[link](#test-naming)] + + # Contributing Nothing written in this guide is set in stone. It's my desire to work