about summary refs log tree commit diff
path: root/test/pronouns/pages_test.clj
diff options
context:
space:
mode:
authorMorgan Astra <m@morganastra.me>2016-09-24 01:28:13 -0700
committerMorgan Astra <m@morganastra.me>2016-09-24 01:28:13 -0700
commit349a4a220167de3d58a59107b423c1d08b53598c (patch)
tree3a044e3f5f37e5ef9be64f21087e7c24012e1351 /test/pronouns/pages_test.clj
parentcf48e336dabbbb9bbe20397c37ce1bb3257c49cc (diff)
use midje for testing per #57
Diffstat (limited to 'test/pronouns/pages_test.clj')
-rw-r--r--test/pronouns/pages_test.clj10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/pronouns/pages_test.clj b/test/pronouns/pages_test.clj
new file mode 100644
index 0000000..04c14ce
--- /dev/null
+++ b/test/pronouns/pages_test.clj
@@ -0,0 +1,10 @@
+(ns pronouns.pages-test
+  (:require [pronouns.pages :as pages]
+            [midje.sweet :refer :all]))
+
+(fact "prose-comma-list turns a list of strings into a prose list with commas"
+      (pages/prose-comma-list ["foo"]) => "foo"
+      (pages/prose-comma-list ["foo" "bar"]) => "foo and bar"
+      (pages/prose-comma-list ["foo" "bar" "baz"]) => "foo, bar, and baz"
+      (pages/prose-comma-list ["foo" "bar" "baz" "bobble"]) => "foo, bar, baz, and bobble"
+      (pages/prose-comma-list []) => "")